Fix Custom theme breaking Compose preview
This commit is contained in:
parent
697f59c943
commit
a96984b4ef
2 changed files with 3 additions and 5 deletions
|
|
@ -53,11 +53,11 @@ fun TachiyomiTheme(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun TachiyomiTheme(
|
fun TachiyomiTheme(
|
||||||
appTheme: AppTheme? = null,
|
|
||||||
amoled: Boolean? = null,
|
|
||||||
// KMK -->
|
// KMK -->
|
||||||
seedColor: Color?,
|
seedColor: Color?,
|
||||||
// KMK <--
|
// KMK <--
|
||||||
|
appTheme: AppTheme? = null,
|
||||||
|
amoled: Boolean? = null,
|
||||||
content: @Composable () -> Unit,
|
content: @Composable () -> Unit,
|
||||||
) {
|
) {
|
||||||
val uiPreferences = Injekt.get<UiPreferences>()
|
val uiPreferences = Injekt.get<UiPreferences>()
|
||||||
|
|
@ -113,13 +113,13 @@ private fun getThemeColorScheme(
|
||||||
appTheme: AppTheme,
|
appTheme: AppTheme,
|
||||||
isAmoled: Boolean,
|
isAmoled: Boolean,
|
||||||
): ColorScheme {
|
): ColorScheme {
|
||||||
val uiPreferences = Injekt.get<UiPreferences>()
|
|
||||||
val colorScheme = when (appTheme) {
|
val colorScheme = when (appTheme) {
|
||||||
AppTheme.MONET -> {
|
AppTheme.MONET -> {
|
||||||
MonetColorScheme(LocalContext.current)
|
MonetColorScheme(LocalContext.current)
|
||||||
}
|
}
|
||||||
// KMK -->
|
// KMK -->
|
||||||
AppTheme.CUSTOM -> {
|
AppTheme.CUSTOM -> {
|
||||||
|
val uiPreferences = Injekt.get<UiPreferences>()
|
||||||
CustomColorScheme(
|
CustomColorScheme(
|
||||||
context = LocalContext.current,
|
context = LocalContext.current,
|
||||||
seed = uiPreferences.colorTheme().get(),
|
seed = uiPreferences.colorTheme().get(),
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ internal class CustomColorScheme(
|
||||||
seed: Int,
|
seed: Int,
|
||||||
style: PaletteStyle,
|
style: PaletteStyle,
|
||||||
) : BaseColorScheme() {
|
) : BaseColorScheme() {
|
||||||
|
|
||||||
private val custom = CustomCompatColorScheme(context, seed, style)
|
private val custom = CustomCompatColorScheme(context, seed, style)
|
||||||
|
|
||||||
override val darkScheme
|
override val darkScheme
|
||||||
|
|
@ -29,7 +28,6 @@ private class CustomCompatColorScheme(
|
||||||
seed: Int,
|
seed: Int,
|
||||||
style: PaletteStyle,
|
style: PaletteStyle,
|
||||||
) : BaseColorScheme() {
|
) : BaseColorScheme() {
|
||||||
|
|
||||||
override val lightScheme = dynamicColorScheme(
|
override val lightScheme = dynamicColorScheme(
|
||||||
seedColor = Color(seed),
|
seedColor = Color(seed),
|
||||||
isDark = false,
|
isDark = false,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue