mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 15:17:05 +05:30
android: add splashscreen
This commit is contained in:
parent
cb468d39f8
commit
497ad78ca5
5 changed files with 14 additions and 3 deletions
|
@ -18,7 +18,8 @@ dependencies {
|
|||
implementation(libs.accompanist.sysuicontroller)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(libs.androidx.appcompat)
|
||||
implementation(libs.androidx.coreKtx)
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.core.splashscreen)
|
||||
implementation(libs.androidx.lifecycle.compose)
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
implementation(libs.androidx.paging.compose)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:label="Claw"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Claw">
|
||||
android:theme="@style/Theme.Claw.SplashScreen">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="colorMode|density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
|
||||
|
|
|
@ -3,6 +3,7 @@ package dev.msfjarvis.claw.android
|
|||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.core.view.WindowCompat
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import dev.msfjarvis.claw.android.ui.LobstersApp
|
||||
|
@ -16,6 +17,7 @@ class MainActivity : ComponentActivity() {
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
installSplashScreen()
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
setContent {
|
||||
LobstersApp(
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Claw.SplashScreen" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">#FF6C0000</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_foreground</item>
|
||||
<item name="windowSplashScreenAnimationDuration">1000</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Claw</item>
|
||||
</style>
|
||||
|
||||
<style name="Platform.Theme.Claw" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
|
||||
<style name="Base.Theme.Claw" parent="Platform.Theme.Claw">
|
||||
|
|
|
@ -21,7 +21,8 @@ accompanist-sysuicontroller = { module = "com.google.accompanist:accompanist-sys
|
|||
androidx-activity-compose = "androidx.activity:activity-compose:1.4.0-beta01"
|
||||
androidx-appcompat = "androidx.appcompat:appcompat:1.4.0-beta01"
|
||||
androidx-browser = "androidx.browser:browser:1.4.0-beta01"
|
||||
androidx-coreKtx = "androidx.core:core-ktx:1.7.0-beta02"
|
||||
androidx-core-ktx = "androidx.core:core-ktx:1.7.0-beta02"
|
||||
androidx-core-splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02"
|
||||
androidx-lifecycle-compose = "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-rc01"
|
||||
androidx-navigation-compose = "androidx.navigation:navigation-compose:2.4.0-alpha10"
|
||||
androidx-paging-compose = "androidx.paging:paging-compose:1.0.0-alpha13"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue