Modern Apps git

← Modern-Apps.git

library: remove the system splash icon

Commit
5cbbdb523ff99b5784867707c69d661b6ad5ae6c
Author
Vayun Mathur <[email protected]>
When
2026-12-05 16:19 UTC (23 hours ago)
Parents
9f7169a
Owner direction: apps should open straight into their UI like
WhatsApp, with no visible splash moment. Android 12+ forces a
splash surface, so this makes it invisible instead of branded.

Theme.General (the shared :library theme every launcher activity
uses) pointed the splash at the launcher glyph: a white disc
behind the app icon, forced on with icon_preferred on API 33+.
Now every variant (day/night, base/API 33+) sets
windowSplashScreenAnimatedIcon to a new fully transparent
@drawable/ic_splash_empty, the icon disc colour to transparent,
and the animation duration to 0, while keeping
windowSplashScreenBackground as ?android:attr/colorBackground -
the theme window background, light in day and dark in night, so
the forced splash is indistinguishable from the app first frame
and exits as soon as that frame draws. Theme.General.Translucent
gets the same empty icon so its headless prompt host cannot flash
an icon either. No installSplashScreen existed anywhere and none
is added: nothing ever kept the splash on screen, so with no icon
and no animation the native surface already exits on first frame
without a new core-splashscreen dependency.

ic_launcher_background is not orphaned: the generated adaptive
launcher icons still use it, so it stays.

Verified: :library:lint, :library:assembleRelease and
:library:testDebugUnitTest pass; consumer APKs (notes, launcher,
weather, web) build and lint green, and aapt2 dump of the release
APKs shows Theme.General carrying the empty icon, duration 0 and
transparent disc in day and night configurations.

Diff

library/src/main/res/drawable/ic_splash_empty.xml
diff --git a/library/src/main/res/drawable/ic_splash_empty.xml b/library/src/main/res/drawable/ic_splash_empty.xmlnew file mode 100644index 0000000000..9d06a84e69--- /dev/null+++ b/library/src/main/res/drawable/ic_splash_empty.xml@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- Empty splash icon: Theme.General points windowSplashScreenAnimatedIcon here so the+     Android 12+ system splash draws no icon at all — just the theme background colour until+     the app's first frame replaces it. Fully transparent, so nothing is ever visible. -->+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">+    <solid android:color="@android:color/transparent" />+</shape>
library/src/main/res/values-night-v33/themes.xml
diff --git a/library/src/main/res/values-night-v33/themes.xml b/library/src/main/res/values-night-v33/themes.xmlindex 5a59fe06af..c47ce59cd6 100644--- a/library/src/main/res/values-night-v33/themes.xml+++ b/library/src/main/res/values-night-v33/themes.xml@@ -1,13 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> <resources> -    <!-- API 33+ night twin of Theme.General: dark parent plus icon_preferred, mirroring-         values-night/themes.xml with the icon forced on. -->+    <!-- API 33+ night twin of Theme.General: dark parent, identical no-splash attrs+         (empty icon, dark window background). -->     <style name="Theme.General" parent="android:Theme.Material.NoActionBar">         <item name="android:windowSoftInputMode">stateUnchanged</item>         <item name="android:windowSplashScreenBackground">?android:attr/colorBackground</item>-        <item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>-        <item name="android:windowSplashScreenBehavior">icon_preferred</item>+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>+        <item name="android:windowSplashScreenIconBackgroundColor">@android:color/transparent</item>+        <item name="android:windowSplashScreenAnimationDuration">0</item>     </style>      <!-- Transparent host for headless prompt activities (passwords' CableActivity):@@ -15,6 +16,7 @@          window must not paint an opaque background over the calling app. -->     <style name="Theme.General.Translucent" parent="android:Theme.Material.NoActionBar">         <item name="android:windowIsTranslucent">true</item>+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>         <item name="android:windowBackground">@android:color/transparent</item>         <item name="android:windowContentOverlay">@null</item>         <item name="android:windowNoTitle">true</item>
library/src/main/res/values-night/themes.xml
diff --git a/library/src/main/res/values-night/themes.xml b/library/src/main/res/values-night/themes.xmlindex 8c8e09b45d..3b34afa744 100644--- a/library/src/main/res/values-night/themes.xml+++ b/library/src/main/res/values-night/themes.xml@@ -2,13 +2,14 @@ <resources>      <!-- Night twin of Theme.General: same style, dark Material parent, so the pre-first-frame-         window is dark in dark mode instead of flashing white. Splash attrs mirror day so the-         icon is forced on with a dark background and the white launcher disc behind it. -->+         window is dark in dark mode instead of flashing white. Splash attrs mirror day: no+         icon, background is the dark window background. -->     <style name="Theme.General" parent="android:Theme.Material.NoActionBar">         <item name="android:windowSoftInputMode">stateUnchanged</item>         <item name="android:windowSplashScreenBackground">?android:attr/colorBackground</item>-        <item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>-        <!-- windowSplashScreenBehavior is API 33+; it lives in values-night-v33/themes.xml. -->+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>+        <item name="android:windowSplashScreenIconBackgroundColor">@android:color/transparent</item>+        <item name="android:windowSplashScreenAnimationDuration">0</item>     </style>      <!-- Transparent host for headless prompt activities (passwords' CableActivity):@@ -16,6 +17,7 @@          window must not paint an opaque background over the calling app. -->     <style name="Theme.General.Translucent" parent="android:Theme.Material.NoActionBar">         <item name="android:windowIsTranslucent">true</item>+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>         <item name="android:windowBackground">@android:color/transparent</item>         <item name="android:windowContentOverlay">@null</item>         <item name="android:windowNoTitle">true</item>
library/src/main/res/values-v33/themes.xml
diff --git a/library/src/main/res/values-v33/themes.xml b/library/src/main/res/values-v33/themes.xmlindex c2c4dde065..5dd3e65603 100644--- a/library/src/main/res/values-v33/themes.xml+++ b/library/src/main/res/values-v33/themes.xml@@ -1,14 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> <resources> -    <!-- API 33+ twin of Theme.General: the base values/themes.xml plus icon_preferred, so the-         system always draws the launcher glyph instead of following the OEM's default (which-         on some devices is an empty splash). Background and icon disc mirror the base file. -->+    <!-- API 33+ twin of Theme.General: identical no-splash attrs (empty icon, window+         background). Nothing here re-enables the icon the base file removes. -->     <style name="Theme.General" parent="android:Theme.Material.Light.NoActionBar">         <item name="android:windowSoftInputMode">stateUnchanged</item>         <item name="android:windowSplashScreenBackground">?android:attr/colorBackground</item>-        <item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>-        <item name="android:windowSplashScreenBehavior">icon_preferred</item>+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>+        <item name="android:windowSplashScreenIconBackgroundColor">@android:color/transparent</item>+        <item name="android:windowSplashScreenAnimationDuration">0</item>     </style>      <!-- Transparent host for headless prompt activities (passwords' CableActivity):@@ -16,6 +16,7 @@          window must not paint an opaque background over the calling app. -->     <style name="Theme.General.Translucent" parent="android:Theme.Material.Light.NoActionBar">         <item name="android:windowIsTranslucent">true</item>+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>         <item name="android:windowBackground">@android:color/transparent</item>         <item name="android:windowContentOverlay">@null</item>         <item name="android:windowNoTitle">true</item>
library/src/main/res/values/themes.xml
diff --git a/library/src/main/res/values/themes.xml b/library/src/main/res/values/themes.xmlindex 3b108b63eb..b2bda69c97 100644--- a/library/src/main/res/values/themes.xml+++ b/library/src/main/res/values/themes.xml@@ -3,12 +3,13 @@      <style name="Theme.General" parent="android:Theme.Material.Light.NoActionBar">         <item name="android:windowSoftInputMode">stateUnchanged</item>-        <!-- System splash (API 31+): explicit single-color background per mode, white disc-             behind the black launcher glyph, and icon forced on API 33+ where the default-             behavior can otherwise show an empty splash. -->+        <!-- No system splash (API 31+ forces the surface, so make it invisible): no icon+             (empty animated icon, no disc behind it), no animation, and the background is+             the window background so the splash is indistinguishable from the first frame. -->         <item name="android:windowSplashScreenBackground">?android:attr/colorBackground</item>-        <item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>-        <!-- windowSplashScreenBehavior is API 33+; it lives in values-v33/themes.xml. -->+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>+        <item name="android:windowSplashScreenIconBackgroundColor">@android:color/transparent</item>+        <item name="android:windowSplashScreenAnimationDuration">0</item>     </style>      <!-- Transparent host for headless prompt activities (passwords' CableActivity):@@ -16,6 +17,7 @@          window must not paint an opaque background over the calling app. -->     <style name="Theme.General.Translucent" parent="android:Theme.Material.Light.NoActionBar">         <item name="android:windowIsTranslucent">true</item>+        <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_empty</item>         <item name="android:windowBackground">@android:color/transparent</item>         <item name="android:windowContentOverlay">@null</item>         <item name="android:windowNoTitle">true</item>