diff --git a/.github/nightly-notes/2026-10-22-fix-splash-follows-launcher-icon.md b/.github/nightly-notes/2026-10-22-fix-splash-follows-launcher-icon.md new file mode 100644 index 0000000000..a73c8e996a --- /dev/null +++ b/.github/nightly-notes/2026-10-22-fix-splash-follows-launcher-icon.md @@ -0,0 +1,2 @@ +## Fixed +- The startup screen follows the Material Sky and Material Mint app icons, and updates as soon as you switch icons diff --git a/app/src/main/java/io/github/aedev/flow/MainActivity.kt b/app/src/main/java/io/github/aedev/flow/MainActivity.kt index e406360b49..a9e0801e3f 100644 --- a/app/src/main/java/io/github/aedev/flow/MainActivity.kt +++ b/app/src/main/java/io/github/aedev/flow/MainActivity.kt @@ -260,7 +260,8 @@ class MainActivity : ComponentActivity() { FlowTheme(theme) { val splashTone = splashTone(MaterialTheme.colorScheme.background) - LaunchedEffect(splashTone) { splashController.rememberTheme(splashTone, appIconController.activeSuffix()) } + val selectedIcon by appIconController.selected.collectAsState(initial = null) + LaunchedEffect(splashTone, selectedIcon) { splashController.rememberTheme(splashTone, appIconController.activeSuffix()) } // Date preferences: five DataStore flows used to be opened per video card, // metadata line, info section, description sheet and info dialog. diff --git a/app/src/main/java/io/github/aedev/flow/platform/AppIconController.kt b/app/src/main/java/io/github/aedev/flow/platform/AppIconController.kt index 6246fd218f..84842bad0d 100644 --- a/app/src/main/java/io/github/aedev/flow/platform/AppIconController.kt +++ b/app/src/main/java/io/github/aedev/flow/platform/AppIconController.kt @@ -9,6 +9,7 @@ import dagger.hilt.android.qualifiers.ApplicationContext import io.github.aedev.flow.data.local.PlayerPreferences import io.github.aedev.flow.util.AppIcons import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext import javax.inject.Inject import javax.inject.Singleton @@ -25,6 +26,9 @@ class AppIconController @ApplicationContext private val context: Context, private val playerPreferences: PlayerPreferences, ) { + /** The saved selection; emits on every switch. */ + val selected: Flow = playerPreferences.selectedAppIcon + /** The alias the launcher currently shows. Reads the package manager, so it runs off the main thread. */ suspend fun activeSuffix(): String = withContext(Dispatchers.IO) { diff --git a/app/src/main/java/io/github/aedev/flow/ui/startup/SplashThemes.kt b/app/src/main/java/io/github/aedev/flow/ui/startup/SplashThemes.kt index 32ad339614..15283de57b 100644 --- a/app/src/main/java/io/github/aedev/flow/ui/startup/SplashThemes.kt +++ b/app/src/main/java/io/github/aedev/flow/ui/startup/SplashThemes.kt @@ -17,62 +17,74 @@ fun splashTone(background: Color): SplashTone = else -> SplashTone.LIGHT } -private class ExpressiveSplash( +private class AliasSplash( @StyleRes val light: Int, @StyleRes val dark: Int, @StyleRes val black: Int, ) -private val ExpressiveSplashes = +private val AliasSplashes = mapOf( ".IconExpressiveScallop" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Scallop, R.style.Theme_Flow_Starting_Dark_Expressive_Scallop, R.style.Theme_Flow_Starting_Black_Expressive_Scallop, ), ".IconExpressiveSegmented" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Segmented, R.style.Theme_Flow_Starting_Dark_Expressive_Segmented, R.style.Theme_Flow_Starting_Black_Expressive_Segmented, ), ".IconExpressivePlay" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Play, R.style.Theme_Flow_Starting_Dark_Expressive_Play, R.style.Theme_Flow_Starting_Black_Expressive_Play, ), ".IconExpressiveSky" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Sky, R.style.Theme_Flow_Starting_Dark_Expressive_Sky, R.style.Theme_Flow_Starting_Black_Expressive_Sky, ), ".IconExpressiveMint" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Mint, R.style.Theme_Flow_Starting_Dark_Expressive_Mint, R.style.Theme_Flow_Starting_Black_Expressive_Mint, ), ".IconExpressiveCookie" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Cookie, R.style.Theme_Flow_Starting_Dark_Expressive_Cookie, R.style.Theme_Flow_Starting_Black_Expressive_Cookie, ), ".IconExpressiveOval" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Oval, R.style.Theme_Flow_Starting_Dark_Expressive_Oval, R.style.Theme_Flow_Starting_Black_Expressive_Oval, ), ".IconExpressivePill" to - ExpressiveSplash( + AliasSplash( R.style.Theme_Flow_Starting_Light_Expressive_Pill, R.style.Theme_Flow_Starting_Dark_Expressive_Pill, R.style.Theme_Flow_Starting_Black_Expressive_Pill, ), + ".IconMaterialSky" to + AliasSplash( + R.style.Theme_Flow_Starting_Light_Material_Sky, + R.style.Theme_Flow_Starting_Dark_Material_Sky, + R.style.Theme_Flow_Starting_Black_Material_Sky, + ), + ".IconMaterialMint" to + AliasSplash( + R.style.Theme_Flow_Starting_Light_Material_Mint, + R.style.Theme_Flow_Starting_Dark_Material_Mint, + R.style.Theme_Flow_Starting_Black_Material_Mint, + ), ) /** @@ -84,7 +96,7 @@ fun splashThemeFor( iconSuffix: String, tone: SplashTone, ): Int { - ExpressiveSplashes[iconSuffix]?.let { splash -> + AliasSplashes[iconSuffix]?.let { splash -> return when (tone) { SplashTone.LIGHT -> splash.light SplashTone.DARK -> splash.dark diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index d946b8e22a..67169b079b 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -82,6 +82,44 @@ @style/Theme.Flow + + + + + + + +