skip to Main Content

I want to create a splashscreen image/psd. This has to be 2048×2048 resolution.
It will be a just an image on the center of the page with a background color.
How to do this without getting lost in photoshop. Any ideas will greatly help.

Thanks

2

Answers


  1. Take a look at: https://www.bignerdranch.com/blog/splash-screens-the-right-way/

    In effect you create a Drawable XML, something like:

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:drawable="@color/gray"/>
        <item>
            <bitmap android:gravity="center" android:src="@mipmap/ic_launcher"/>
        </item>
    </layer-list>
    

    Then in your Style Values:

    <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:windowBackground">@drawable/background_splash</item>
    </style>
    

    Create a new Activity (Blank) and make it your Start activity (in Android Manifest):

    <activity
        android:name=".SplashActivity"
        android:theme="@style/SplashTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
    
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    

    Teh ‘SplashActivity’ should just forward you to your MainActivity; something like:

    public class SplashActivity extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
            Intent intent = new Intent(this, MainActivity.class);
            startActivity(intent);
            finish();
        }
    }
    

    Note that you do not inflate a view at all! You use the Window background from your style to do the work.

    Login or Signup to reply.
  2. If you want to go for more flexible option yet without getting your hands dirty on complex implementation then this lib will greatly help you out.

    https://github.com/ViksaaSkool/AwesomeSplash

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search