From e62b6b02abeee77863ba5a21a39548e13a595133 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 7 Jul 2017 11:21:22 +0300 Subject: [PATCH] Add delay for splash screen --- OsmAnd/AndroidManifest-free.xml | 2 +- OsmAnd/AndroidManifest-freedev.xml | 2 +- OsmAnd/AndroidManifest.xml | 16 +++++++++---- OsmAnd/res/values/styles.xml | 6 ++--- .../plus/activities/SplashActivity.java | 24 +++++++++++++++++++ 5 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/activities/SplashActivity.java diff --git a/OsmAnd/AndroidManifest-free.xml b/OsmAnd/AndroidManifest-free.xml index 0b67c77855..b2dd92f468 100644 --- a/OsmAnd/AndroidManifest-free.xml +++ b/OsmAnd/AndroidManifest-free.xml @@ -7,7 +7,7 @@ android:label="@string/app_name_free" tools:replace="android:icon, android:label"> - + + @@ -101,7 +106,7 @@ - + @@ -114,7 +119,7 @@ - + @@ -154,7 +159,10 @@ + + diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index 88d81f2d66..6c71f7b927 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -74,15 +74,15 @@ ?attr/selectableItemBackground - - - diff --git a/OsmAnd/src/net/osmand/plus/activities/SplashActivity.java b/OsmAnd/src/net/osmand/plus/activities/SplashActivity.java new file mode 100644 index 0000000000..9869191fd9 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/activities/SplashActivity.java @@ -0,0 +1,24 @@ +package net.osmand.plus.activities; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.support.annotation.Nullable; + +public class SplashActivity extends OsmandActionBarActivity { + private final static int SPLASH_DISPLAY_LENGTH = 3000; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + Intent i = new Intent(SplashActivity.this, MapActivity.class); + startActivity(i); + finish(); + } + }, SPLASH_DISPLAY_LENGTH); + } +} \ No newline at end of file