Add delay for splash screen

This commit is contained in:
PavelRatushny 2017-07-07 11:21:22 +03:00
parent cf608db4b3
commit e62b6b02ab
5 changed files with 41 additions and 9 deletions

View file

@ -7,7 +7,7 @@
android:label="@string/app_name_free"
tools:replace="android:icon, android:label">
<activity
android:name="net.osmand.plus.activities.MapActivity"
android:name="net.osmand.plus.activities.SplashActivity"
android:theme="@style/SplashScreenFree"
tools:replace="android:theme"/>
<service

View file

@ -6,7 +6,7 @@
android:icon="@mipmap/icon_nightly"
tools:replace="android:icon">
<activity
android:name="net.osmand.plus.activities.MapActivity"
android:name="net.osmand.plus.activities.SplashActivity"
android:theme="@style/SplashScreenFreeDev"
tools:replace="android:theme"/>
<service

View file

@ -73,8 +73,13 @@
android:resource="@xml/paths" />
</provider>
<activity android:name="net.osmand.plus.activities.MapActivity" android:label="@string/app_name" android:theme="@style/SplashScreenPlus"
android:screenOrientation="unspecified" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize">
<activity
android:name="net.osmand.plus.activities.SplashActivity"
android:theme="@style/SplashScreenPlus"
android:screenOrientation="unspecified"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
@ -154,7 +159,10 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="net.osmand.plus.activities.MapActivity" android:label="@string/app_name"
android:screenOrientation="unspecified" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize">
</activity>
<receiver android:name="net.osmand.plus.audionotes.MediaRemoteControlReceiver">

View file

@ -74,15 +74,15 @@
<item name="android:background">?attr/selectableItemBackground</item>
</style>
<style name="SplashScreenPlus" parent="OsmandLightTheme">
<style name="SplashScreenPlus" parent="OsmandLightTheme.NoActionbar">
<item name="android:windowBackground">@drawable/splash_screen_plus</item>
</style>
<style name="SplashScreenFree" parent="OsmandLightTheme">
<style name="SplashScreenFree" parent="OsmandLightTheme.NoActionbar">
<item name="android:windowBackground">@drawable/splash_screen_free</item>
</style>
<style name="SplashScreenFreeDev" parent="OsmandLightTheme">
<style name="SplashScreenFreeDev" parent="OsmandLightTheme.NoActionbar">
<item name="android:windowBackground">@drawable/splash_screen_free_dev</item>
</style>

View file

@ -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);
}
}