AppThemePreference: Filter dynamic theme if it's not available (#8250)

This commit is contained in:
Ivan Iskandar 2022-10-20 09:43:41 +07:00 committed by GitHub
parent d03cbbe0cd
commit 4b5f965cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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