m7c: brand splash instead of the white startup screen

- LaunchTheme/NormalTheme on #05070A (was the stock light theme + white
  windowBackground) and the Android 12 splash API in values-v31
- splash icon is a padded 512x512 canvas: Android masks everything outside the
  inner 192dp of the 288dp icon area, which clipped the wordmark at the top;
  the icon plate is set to the icon navy
- Flutter splash (lib/src/ui/splash_screen.dart): logo pulses (scale 0.96-1.04,
  opacity 0.72-1.0, 1100 ms) plus a thin progress line, min 700 ms measured
  from the first Flutter frame
- boot work (session, FFI library, ad SDK) now runs after the first frame and
  the game fades in over the splash: no blocking work before the first frame
- numbers (Redmi Note 10, API 31): debug 3053 ms, profile/AOT 2040 ms on the
  first start, 850-960 ms on later cold starts, ready log ~1030 ms
- fixed: top-level Stopwatch only started on first access (Dart lazily
  initialises top-level finals), so the boot log always showed 0 ms
- tools/device/startup.sh measures cold start + boot log; testing.md documents
  the splash chain and the MIUI release-install trap
This commit is contained in:
2026-10-25 02:34:09 +02:00
parent 94c3ef0f63
commit 92b5ef16cb
17 changed files with 362 additions and 89 deletions
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<!-- v21 variant of the launch screen (identical content, kept in sync). -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<item android:drawable="@color/launch_bg" />
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
android:src="@drawable/launch_logo" />
</item>
</layer-list>
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<!-- Launch screen shown from process start until Flutter draws its first frame.
Brand background + the same logo the in-app splash pulses, so the handover
from native window to Flutter is invisible. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<item android:drawable="@color/launch_bg" />
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
android:src="@drawable/launch_logo" />
</item>
</layer-list>
@@ -2,9 +2,9 @@
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:statusBarColor">@color/launch_bg</item>
<item name="android:navigationBarColor">@color/launch_bg</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
@@ -13,6 +13,8 @@
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
<item name="android:windowBackground">@color/launch_bg</item>
<item name="android:statusBarColor">@color/launch_bg</item>
<item name="android:navigationBarColor">@color/launch_bg</item>
</style>
</resources>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Android 12+ draws its own splash screen; configure it to look like ours
instead of the default (which would flash the launcher icon on white). -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowSplashScreenBackground">@color/launch_bg</item>
<!-- Padded 512x512 canvas: Android masks everything outside the inner
192dp of the 288dp icon area, so the mark must sit inside it. -->
<item name="android:windowSplashScreenAnimatedIcon">@drawable/launch_logo_splash</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/launch_plate</item>
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:statusBarColor">@color/launch_bg</item>
<item name="android:navigationBarColor">@color/launch_bg</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@color/launch_bg</item>
<item name="android:statusBarColor">@color/launch_bg</item>
<item name="android:navigationBarColor">@color/launch_bg</item>
</style>
</resources>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Same near-black the game canvas uses, so launch -> splash -> game never flashes. -->
<color name="launch_bg">#FF05070A</color>
<!-- Plate behind the Android 12+ splash icon: the icon navy, so the mark
reads as a deliberate tile instead of a floating sticker. -->
<color name="launch_plate">#FF0B1220</color>
</resources>
+10 -6
View File
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<!-- Theme applied to the Android Window while the process is starting.
Dark parent + dark background: the white flash of the stock template is gone.
The Flutter splash takes over with the same logo and the same colour. -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:statusBarColor">@color/launch_bg</item>
<item name="android:navigationBarColor">@color/launch_bg</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
@@ -12,7 +14,9 @@
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@color/launch_bg</item>
<item name="android:statusBarColor">@color/launch_bg</item>
<item name="android:navigationBarColor">@color/launch_bg</item>
</style>
</resources>