Show splash window after 1500 ms

This commit is contained in:
M66B 2019-06-09 11:47:57 +02:00
parent 794f1840a7
commit 26eb0c1f6d
2 changed files with 10 additions and 4 deletions

View File

@ -25,6 +25,7 @@ import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
@ -51,6 +52,13 @@ public class ActivityMain extends AppCompatActivity implements FragmentManager.O
if (prefs.getBoolean("eula", false)) {
super.onCreate(savedInstanceState);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
getWindow().setBackgroundDrawableResource(R.drawable.splash);
}
}, 1500);
new SimpleTask<Boolean>() {
@Override
protected Boolean onExecute(Context context, Bundle args) {

View File

@ -76,10 +76,8 @@
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
<style name="Theme.Splash" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="checkboxStyle" parent="Base.Widget.AppCompat.CompoundButton.CheckBox">