feat: splash screen

This commit is contained in:
Canny 2023-01-28 02:30:39 +03:00
parent 9536cdcae1
commit 49f9dfcf95
3 changed files with 8 additions and 1 deletions

View file

@ -48,6 +48,7 @@ dependencies {
// AndroidX Core
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
implementation("androidx.core:core-splashscreen:1.0.0")
implementation("androidx.activity:activity-compose:1.6.1")
// Compose

View file

@ -4,6 +4,7 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import app.revanced.manager.compose.destination.Destination
import app.revanced.manager.compose.ui.theme.ReVancedManagerTheme
import dev.olshevski.navigation.reimagined.AnimatedNavHost
@ -15,6 +16,8 @@ class MainActivity : ComponentActivity() {
@ExperimentalAnimationApi
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
installSplashScreen()
setContent {
ReVancedManagerTheme(
darkTheme = true, // TODO: Implement preferences

View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ReVancedManager" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.ReVancedManager" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="postSplashScreenTheme">@style/Theme.AppCompat.NoActionBar</item>
</style>
</resources>