adding a Splash Activity

This commit is contained in:
tibbi 2017-11-06 20:36:19 +01:00
parent 2420b7261d
commit 06407722d3
3 changed files with 20 additions and 2 deletions

View File

@ -14,7 +14,10 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".activities.MainActivity">
<activity
android:name=".activities.SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -22,6 +25,8 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activities.MainActivity"/>
<activity <activity
android:name=".activities.SettingsActivity" android:name=".activities.SettingsActivity"
android:label="@string/settings" android:label="@string/settings"

View File

@ -36,7 +36,7 @@ class SettingsActivity : BaseSimpleActivity() {
settings_hide_launcher_icon.toggle() settings_hide_launcher_icon.toggle()
config.hideLauncherIcon = settings_hide_launcher_icon.isChecked config.hideLauncherIcon = settings_hide_launcher_icon.isChecked
val componentName = ComponentName(this, MainActivity::class.java) val componentName = ComponentName(this, SplashActivity::class.java)
val state = if (config.hideLauncherIcon) PackageManager.COMPONENT_ENABLED_STATE_DISABLED else PackageManager.COMPONENT_ENABLED_STATE_ENABLED val state = if (config.hideLauncherIcon) PackageManager.COMPONENT_ENABLED_STATE_DISABLED else PackageManager.COMPONENT_ENABLED_STATE_ENABLED
packageManager.setComponentEnabledSetting(componentName, state, PackageManager.DONT_KILL_APP) packageManager.setComponentEnabledSetting(componentName, state, PackageManager.DONT_KILL_APP)
} }

View File

@ -0,0 +1,13 @@
package com.simplemobiletools.thankyou.activities
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
startActivity(Intent(this, MainActivity::class.java))
finish()
}
}