themes.xml
42 lines · 2.2 KB
Changed in: 0.5.0
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- |
| 3 | Android 12+ system splash screen overrides. |
| 4 | |
| 5 | Without these, Android 12+ wraps the launcher icon in a circular white |
| 6 | background ("BIG WHITE CIRCLE WITH A LITTLE BADGE ICON INSIDE"). That's |
| 7 | the platform default — it's NOT something the app "asks for" — it just |
| 8 | happens to every app that targets API 31+ and ships a static-PNG launcher |
| 9 | icon (as ours does). |
| 10 | |
| 11 | These overrides do three things: |
| 12 | 1. windowSplashScreenBackground — the background canvas behind the icon. |
| 13 | Set to the app's own dark surface color (#17130F) so the splash matches |
| 14 | what's about to load instead of flashing white first. |
| 15 | 2. windowSplashScreenIconBackgroundColor — the inner circle that Android |
| 16 | draws BEHIND the icon if the icon doesn't fill the canvas. Same dark |
| 17 | color → effectively invisible, no "white circle around the badge." |
| 18 | 3. windowSplashScreenAnimatedIcon — what icon to show. We use the |
| 19 | earhorn_badge drawable directly (rather than the launcher mipmap) so |
| 20 | the system shows the full circular brand mark with no system-applied |
| 21 | cropping. |
| 22 | |
| 23 | Lives in values-v31 because these attrs only exist on API 31+. On older |
| 24 | Android versions the platform falls back to drawing windowBackground |
| 25 | (set in the base Theme.Earhorn) — which is already the dark surface, |
| 26 | so older devices have always shown a solid dark splash. |
| 27 | --> |
| 28 | <resources> |
| 29 | <style name="Theme.Earhorn" parent="android:Theme.Material.NoActionBar"> |
| 30 | <item name="android:windowBackground">@color/surface_base</item> |
| 31 | <item name="android:windowNoTitle">true</item> |
| 32 | |
| 33 | <!-- Match the dark app surface, no white circle. --> |
| 34 | <item name="android:windowSplashScreenBackground">@color/surface_base</item> |
| 35 | <item name="android:windowSplashScreenIconBackgroundColor">@color/surface_base</item> |
| 36 | |
| 37 | <!-- Use the brand badge directly. The system still applies its own |
| 38 | icon-mask treatment but with a matching dark background it just |
| 39 | reads as the badge floating on the app's surface color. --> |
| 40 | <item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_badge</item> |
| 41 | </style> |
| 42 | </resources> |


