mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
keep the theme wrapper stable so the layout doesn't remount when artwork arrives
ArtworkTheme swapped between a bare content() and a MaterialTheme wrapper depending on whether a scheme existed. When the first track's artwork (or a screen's) resolved, that branch change remounted the whole subtree, reloading images, resetting scroll and restarting the mini player. Always provide a MaterialTheme, falling back to the ambient scheme when there is no artwork, and cover it with a test.
This commit is contained in:
@@ -204,12 +204,11 @@ fun ArtworkTheme(
|
||||
colors: ArtworkColors?,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val scheme = colors?.scheme
|
||||
if (scheme == null) {
|
||||
content()
|
||||
} else {
|
||||
MaterialTheme(colorScheme = scheme, typography = SubtracksTypography, content = content)
|
||||
}
|
||||
MaterialTheme(
|
||||
colorScheme = colors?.scheme ?: MaterialTheme.colorScheme,
|
||||
typography = SubtracksTypography,
|
||||
content = content,
|
||||
)
|
||||
}
|
||||
|
||||
fun playerSurfaceColor(artwork: ArtworkColors): Color {
|
||||
|
||||
Reference in New Issue
Block a user