ux: SplashScreen на холодном старте (Этап 2 п.12)
androidx core-splashscreen 1.0.1: тема Theme.F7.Splash (фон #FBFBFB как F7Colors.Background + иконка ic_launcher), postSplashScreenTheme — прежняя тема приложения. installSplashScreen() в MainActivity.onCreate до super. Вместо голого белого экрана при запуске.
This commit is contained in:
@@ -128,6 +128,7 @@ dependencies {
|
|||||||
implementation libs.firebase.messaging
|
implementation libs.firebase.messaging
|
||||||
implementation libs.coroutines.play.services
|
implementation libs.coroutines.play.services
|
||||||
implementation libs.multidex
|
implementation libs.multidex
|
||||||
|
implementation libs.core.splashscreen
|
||||||
implementation libs.biometric
|
implementation libs.biometric
|
||||||
implementation libs.fragment.ktx
|
implementation libs.fragment.ktx
|
||||||
implementation libs.camera.camera2
|
implementation libs.camera.camera2
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
android:resource="@mipmap/ic_launcher" />
|
android:resource="@mipmap/ic_launcher" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
android:theme="@style/Theme.F7.Splash"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.util.Log
|
|||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
@@ -43,6 +44,8 @@ class MainActivity : FragmentActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
// Системный сплэш (фон + иконка) на холодном старте вместо белого экрана
|
||||||
|
installSplashScreen()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
if (!handleIncomingIntent(intent)) {
|
if (!handleIncomingIntent(intent)) {
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Сплэш при холодном старте (androidx core-splashscreen): фон в цвет
|
||||||
|
F7Colors.Background + иконка приложения; после — прежняя тема. -->
|
||||||
|
<style name="Theme.F7.Splash" parent="Theme.SplashScreen">
|
||||||
|
<item name="windowSplashScreenBackground">#FBFBFB</item>
|
||||||
|
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
|
||||||
|
<item name="postSplashScreenTheme">@android:style/Theme.Material.Light.NoActionBar</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -60,3 +60,4 @@ multidex = { group = "androidx.multidex", name = "multidex", version.ref = "mult
|
|||||||
fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment" }
|
fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment" }
|
||||||
documentfile = { group = "androidx.documentfile", name = "documentfile", version.ref = "documentfile" }
|
documentfile = { group = "androidx.documentfile", name = "documentfile", version.ref = "documentfile" }
|
||||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||||
|
core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version = "1.0.1" }
|
||||||
|
|||||||
Reference in New Issue
Block a user