Links & DependenciesSplashScreenActivity.javaAndroidManifest.xmlstyles.xml
Library with installation instructions:
package com.codinginflow.easysplashscreenexample; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import gr.net.maroulis.library.EasySplashScreen; public class SplashScreenActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EasySplashScreen config = new EasySplashScreen(SplashScreenActivity.this) .withFullScreen() .withTargetActivity(MainActivity.class) .withSplashTimeOut(5000) .withBackgroundColor(Color.parseColor("#1a1b29")) .withHeaderText("Header") .withFooterText("Footer") .withBeforeLogoText("Before Logo Text") .withAfterLogoText("After Logo Text") .withLogo(R.mipmap.ic_launcher_round); config.getHeaderTextView().setTextColor(Color.WHITE); config.getFooterTextView().setTextColor(Color.WHITE); config.getBeforeLogoTextView().setTextColor(Color.WHITE); config.getAfterLogoTextView().setTextColor(Color.WHITE); View easySplashScreen = config.create(); setContentView(easySplashScreen); } }
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.codinginflow.easysplashscreenexample"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".SplashScreenActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MainActivity"></activity> </application> </manifest>
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> </resources>