From 4b5f965ceae62d9a62d3b1f89d7986ec76111cff Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Thu, 20 Oct 2022 09:43:41 +0700 Subject: [PATCH] AppThemePreference: Filter dynamic theme if it's not available (#8250) --- .../more/settings/widget/AppThemePreferenceWidget.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt index 78f2d1da4b..85a9e7122c 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt @@ -45,6 +45,8 @@ import eu.kanade.presentation.components.DIVIDER_ALPHA import eu.kanade.presentation.components.MangaCover import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.util.secondaryItemAlpha +import eu.kanade.tachiyomi.util.system.DeviceUtil +import eu.kanade.tachiyomi.util.system.isDynamicColorAvailable @Composable internal fun AppThemePreferenceWidget( @@ -72,7 +74,8 @@ private fun AppThemesList( onItemClick: (AppTheme) -> Unit, ) { val appThemes = remember { - AppTheme.values().filter { it.titleResId != null } + AppTheme.values() + .filterNot { it.titleResId == null || (it == AppTheme.MONET && !DeviceUtil.isDynamicColorAvailable) } } LazyRow( modifier = Modifier