weather,web,watch: match the no-splash theme where apps bypass it
- Commit
af52efb6309af306e8eebcb120ef1bea38035948- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-05 16:19 UTC (16 hours ago)
- Parents
5cbbdb5
Three launcher themes did not simply inherit the shared Theme.General no-splash attrs fixed in :library: - weather: Theme.Weather overrides windowBackground with its own @color/window_background (system_neutral1_100 day / _800 night) but the splash still used the shared colour, so cold start would flash between them. It now sets windowSplashScreenBackground to the same window_background. - web: the night Theme.Web was parented on the raw platform Material theme instead of Theme.General, bypassing every shared splash attr and showing the default icon splash in dark mode. It now parents Theme.General (whose night twin is that same dark Material parent) and keeps only isLightTheme=false. - watch-wear: the watch conduit app does not depend on :library and used the raw platform theme, so it showed the default icon splash. It gains Theme.WatchWear (same dark Material parent) with the same recipe - empty icon, transparent disc, duration 0, window-background splash - plus its own copy of the empty drawable, and the manifest points at it. Verified: :weather:lint, :weather:lintVitalRelease, :weather:assembleRelease, :web:lint, :web:lintVitalRelease, :web:assembleRelease, :watch:wear:lint and :watch:wear:assembleRelease pass; aapt2 dump of the weather, web and watch-wear release APKs shows the empty splash icon and matching splash background in the merged themes.
Diff
watch-wear/src/main/AndroidManifest.xml
diff --git a/watch-wear/src/main/AndroidManifest.xml b/watch-wear/src/main/AndroidManifest.xmlindex 3cc2f93239..b2a66234b6 100644--- a/watch-wear/src/main/AndroidManifest.xml+++ b/watch-wear/src/main/AndroidManifest.xml@@ -32,7 +32,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true"- android:theme="@android:style/Theme.Material.NoActionBar">+ android:theme="@style/Theme.WatchWear"> <meta-data android:name="com.google.android.wearable.standalone"
watch-wear/src/main/res/drawable/ic_splash_empty.xml
diff --git a/watch-wear/src/main/res/drawable/ic_splash_empty.xml b/watch-wear/src/main/res/drawable/ic_splash_empty.xmlnew file mode 100644index 0000000000..a2f8c3effb--- /dev/null+++ b/watch-wear/src/main/res/drawable/ic_splash_empty.xml@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- Empty splash icon (copy of :library's): this module does not depend on :library, so it+ carries its own. Theme.WatchWear points windowSplashScreenAnimatedIcon here so the+ system splash draws no icon — just the window background until the first frame. -->+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">+ <solid android:color="@android:color/transparent" />+</shape>
watch-wear/src/main/res/values/themes.xml
diff --git a/watch-wear/src/main/res/values/themes.xml b/watch-wear/src/main/res/values/themes.xmlnew file mode 100644index 0000000000..1c1c3ce069--- /dev/null+++ b/watch-wear/src/main/res/values/themes.xml@@ -0,0 +1,13 @@+<?xml version="1.0" encoding="utf-8"?>+<resources>+ <!-- Watch app theme: same parent as before, plus the shared no-splash recipe (this+ module cannot inherit :library's Theme.General). No icon, no animation, splash+ background is the (dark) window background, so cold start is just that colour+ until Wear Compose draws its first frame. -->+ <style name="Theme.WatchWear" parent="android:Theme.Material.NoActionBar">+ <item name="android:windowSplashScreenBackground">?android:attr/colorBackground</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>+</resources>
weather/src/main/res/values/themes.xml
diff --git a/weather/src/main/res/values/themes.xml b/weather/src/main/res/values/themes.xmlindex d6814ec379..3a66f21534 100644--- a/weather/src/main/res/values/themes.xml+++ b/weather/src/main/res/values/themes.xml@@ -2,5 +2,8 @@ <resources> <style name="Theme.Weather" parent="Theme.General"> <item name="android:windowBackground">@color/window_background</item>+ <!-- The splash must match this app's own window background, not the shared+ Theme.General colour, or cold start flashes between the two. -->+ <item name="android:windowSplashScreenBackground">@color/window_background</item> </style> </resources>
web/src/main/res/values-night/themes.xml
diff --git a/web/src/main/res/values-night/themes.xml b/web/src/main/res/values-night/themes.xmlindex 353eaf41a1..3cf86ac98b 100644--- a/web/src/main/res/values-night/themes.xml+++ b/web/src/main/res/values-night/themes.xml@@ -1,8 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="Theme.Web" parent="android:Theme.Material.NoActionBar">- <item name="android:windowSoftInputMode">stateUnchanged</item>+ <!-- Parent is Theme.General (its night twin is the same dark Material parent) so Web+ inherits the shared no-splash attrs instead of the platform default icon splash. -->+ <style name="Theme.Web" parent="Theme.General"> <item name="android:isLightTheme">false</item> </style>