Implement splash screen

This commit is contained in:
FooIbar committed 2023-10-20 17:36:59 +08:00
1 parent 64a6074e02
commit 2f0571e384
5 files changed
+11

No files matched your search

+1
View File
@@ -209,6 +209,7 @@ dependencies {
implementation(libs.bundles.compose)
implementation(libs.androidx.core)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.androidx.coordinatorlayout)
+1
View File
@@ -44,6 +44,7 @@
android:configChanges="screenSize"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/AppTheme.Splash"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -32,6 +32,7 @@ import androidx.activity.OnBackPressedCallback
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.annotation.StringRes
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.customview.widget.Openable
import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.lifecycleScope
@@ -182,6 +183,7 @@ class MainActivity : EhActivity() {
}
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
+5
View File
@@ -18,6 +18,11 @@
<style name="AppTheme" parent="Base.AppTheme" />
<style name="AppTheme.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style>
<style name="ProgressView">
<item name="android:indeterminate">true</item>
<item name="android:minWidth">48dp</item>
+2
View File
@@ -9,6 +9,7 @@ androidx-collection = "1.3.0"
androidx-constraintlayout-compose = "1.1.0-alpha13"
androidx-coordinatorlayout = "1.2.0"
androidx-core = "1.12.0"
androidx-core-splashscreen = "1.1.0-alpha02"
androidx-fragment = "1.7.0-alpha06"
androidx-lifecycle = "2.6.2"
androidx-navigation = "2.7.4"
@@ -50,6 +51,7 @@ androidx-collection = { module = "androidx.collection:collection-ktx", version.r
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "androidx-constraintlayout-compose" }
androidx-coordinatorlayout = { module = "androidx.coordinatorlayout:coordinatorlayout", version.ref = "androidx-coordinatorlayout" }
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-core-splashscreen" }
androidx-fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" }
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "androidx-lifecycle" }