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:
@@ -37,6 +37,7 @@
|
||||
android:resource="@mipmap/ic_launcher" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:theme="@style/Theme.F7.Splash"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.util.Log
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
@@ -43,6 +44,8 @@ class MainActivity : FragmentActivity() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// Системный сплэш (фон + иконка) на холодном старте вместо белого экрана
|
||||
installSplashScreen()
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
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>
|
||||
Reference in New Issue
Block a user