Files
SoulStream/src-tauri/android/res/values-v31/themes.xml
T
KeelrLeek d42645d2a0 android: the icon where it moves — the glyph, the lock screen and a splash that is not white
Both notification glyphs are the same falcon now, the logo kit's monochrome
path verbatim inside a group that re-frames it for a 24dp box — the playback
card's and the transfers notice's, because a note beside an arrow does not
read as one app, and the transfers one keeps the tray bar it always had so
the falcon dives into it. The fill stays white on transparent: the shade
composites a small icon from its alpha channel alone and tints it itself, so
a coloured export would arrive as a white blob.

The lock screen falls back to the app's own icon instead of a grey hole.
`MediaHub.art` is null from the moment a track changes until the frontend has
finished decoding its cover, and null forever for a track with none, so
`appIcon()` decodes the launcher icon ONCE — through the PackageManager,
because a library module's R has no `ic_launcher` — and hands it to both the
card and `METADATA_KEY_ALBUM_ART`. The app manifest lives in gitignored
`gen/` and declares no category, so the media-session plugin's own library
manifest contributes `android:appCategory="audio"` through the merger, and a
`Theme.App.Starting` on the brand ground replaces Android 12+'s white flash —
in `values-v31` and `values-night-v31` both, because the qualifier order puts
night mode ahead of platform version and a splash written only into
`values-v31` is silently ignored on a dark-mode phone.

The walk gains `media-card`: after the session block, the card is still
posted on the `playback` channel with the playing track's title on it, and
`media-keys` below it still gets the transport back — which is what a
drawable the shade cannot inflate would actually break. The glyph itself and
the splash are screenshots; `dumpsys notification` prints a resource id and
never a pixel, and the splash is gone before the walk's first frame.
2026-09-15 07:22:01 -05:00

44 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- The Android 12+ splash, and a full replacement of Theme.app for API 31+.
The platform draws a splash whether we ask for one or not, and its own is
a white flash. These attributes put the brand ground and the app's icon
there instead. They have to sit on the theme the ACTIVITY resolves, which
is Theme.app (declared on the application, inherited by MainActivity), so
Theme.App.Starting is its PARENT rather than a style nothing references:
androidx.core:core-splashscreen is not a dependency of the app module, so
the platform attributes are the whole mechanism and there is no
postSplashScreenTheme to hand back to. Theme.app already is the
post-splash theme.
ANYTHING ADDED TO THE GENERATED values/themes.xml MUST BE ADDED HERE TOO.
This file replaces Theme.app outright on API 31+; it does not extend it.
Its night twin, values-night-v31/themes.xml, is not optional. The resource
qualifier order puts NIGHT MODE ahead of PLATFORM VERSION, so on a
dark-mode Android 12+ phone the generated values-night/themes.xml beats
this file and a splash written only here is silently ignored.
gen/ is regenerated and gitignored, so this lives under src-tauri/android/
res/ and build.sh and dev.sh lay it over the generated project. -->
<resources>
<style name="Theme.App.Starting" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- the kit's `night`, source/brand-tokens.json. A literal rather than
a colour resource so it cannot collide with a name the
launcher-icon round chooses. -->
<item name="android:windowSplashScreenBackground">#FF05080B</item>
<!-- the app's own icon resource, whatever it is: this follows the
launcher icon rather than naming one of its layers, so it cannot
fail to resolve, and on API 26+ it is the adaptive icon, which is
what the splash slot is shaped for -->
<item name="android:windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
<!-- and the frame between the splash dismissing and the WebView's
first paint, which is otherwise the same white. This is the one
item here that is not strictly "a splash": deleting it leaves the
rest of this file working. -->
<item name="android:windowBackground">#FF05080B</item>
</style>
<style name="Theme.app" parent="Theme.App.Starting" />
</resources>