feat(android): NowPlaying dominant-color gradient backdrop (audit v2 #17, slice 1)
Adds androidx.palette dependency and a rememberDominantColor() helper that pulls the cover bitmap via Coil's singleton loader (shares the cache with the on-screen AsyncImage), runs Palette extraction on Dispatchers.Default, and animates the resulting color with animateColorAsState so track changes tween smoothly. NowPlayingScreen wraps the body in a Box with a vertical gradient (0% dominant @ 55%α → 45% dominant @ 18%α → 100% scheme.background) and lets the Scaffold's containerColor go transparent so the gradient shows through. Falls back to a near-transparent gradient on bitmap-load failure so the screen never sits on flat black. Hero transition (MiniPlayer → NowPlaying cover) and cover preload still pending — those land in a follow-up commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ kotlinx-datetime = "0.6.1"
|
||||
kotlinx-serialization-converter = "1.0.0"
|
||||
media3 = "1.10.1"
|
||||
coil = "3.0.0-rc02"
|
||||
palette = "1.0.0"
|
||||
timber = "5.0.1"
|
||||
work = "2.10.0"
|
||||
lifecycle = "2.8.7"
|
||||
@@ -72,6 +73,7 @@ media3-datasource-okhttp = { module = "androidx.media3:media3-datasource-okhttp"
|
||||
media3-ui = { module = "androidx.media3:media3-ui", version.ref = "media3" }
|
||||
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
|
||||
coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coil" }
|
||||
androidx-palette = { module = "androidx.palette:palette-ktx", version.ref = "palette" }
|
||||
# CMP (Compose Multiplatform) variant — provides icons as ImageVector
|
||||
# objects (e.g. `Icon(Lucide.Disc3, ...)`). The -android variant ships
|
||||
# Vector Drawable XML accessed via painterResource(), which is less
|
||||
|
||||
Reference in New Issue
Block a user