Fix splash screen
This commit is contained in:
parent
c5814b7635
commit
a2dbadccd5
3 changed files with 5 additions and 23 deletions
|
|
@ -32,7 +32,6 @@
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.AliucordManager.SplashScreen"
|
|
||||||
tools:ignore="AllowBackup">
|
tools:ignore="AllowBackup">
|
||||||
<service android:name=".installer.service.InstallService" />
|
<service android:name=".installer.service.InstallService" />
|
||||||
<provider
|
<provider
|
||||||
|
|
@ -47,7 +46,8 @@
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true">
|
android:exported="true"
|
||||||
|
android:theme="@style/Theme.AliucordManager.SplashScreen">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,9 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.*
|
import android.os.*
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.view.animation.AccelerateInterpolator
|
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||||
import com.aliucord.manager.preferences.Prefs
|
import com.aliucord.manager.preferences.Prefs
|
||||||
|
|
@ -22,24 +20,13 @@ import com.aliucord.manager.preferences.sharedPreferences
|
||||||
import com.aliucord.manager.ui.component.ManagerScaffold
|
import com.aliucord.manager.ui.component.ManagerScaffold
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
import com.aliucord.manager.ui.theme.ManagerTheme
|
||||||
import com.aliucord.manager.ui.theme.Theme
|
import com.aliucord.manager.ui.theme.Theme
|
||||||
import com.google.accompanist.permissions.ExperimentalPermissionsApi
|
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
@OptIn(ExperimentalMaterial3Api::class, ExperimentalPermissionsApi::class)
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
installSplashScreen()
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
installSplashScreen().setOnExitAnimationListener { provider ->
|
|
||||||
provider.view.animate().apply {
|
|
||||||
interpolator = AccelerateInterpolator()
|
|
||||||
duration = 200L
|
|
||||||
|
|
||||||
alpha(0f)
|
|
||||||
withEndAction(provider::remove)
|
|
||||||
start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sharedPreferences = getPreferences(Context.MODE_PRIVATE)
|
sharedPreferences = getPreferences(Context.MODE_PRIVATE)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.AliucordManager.SplashScreen" parent="Theme.SplashScreen">
|
<style name="Theme.AliucordManager.SplashScreen" parent="Theme.SplashScreen">
|
||||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
||||||
<item name="postSplashScreenTheme">@style/Theme.AliucordManager</item>
|
<item name="postSplashScreenTheme">@style/Theme.AppCompat.NoActionBar</item>
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="Theme.AliucordManager" parent="Theme.AppCompat">
|
|
||||||
<item name="colorPrimary">@color/primary</item>
|
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue