mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-25 02:52:11 +02:00
fix: Reset cached theme on theme change to avoid broken colors (#2527)
This commit is contained in:
parent
02d2153195
commit
9f44541bbd
@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
|
|||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import app.revanced.manager.domain.manager.PreferencesManager
|
import app.revanced.manager.domain.manager.PreferencesManager
|
||||||
import app.revanced.manager.ui.theme.Theme
|
import app.revanced.manager.ui.theme.Theme
|
||||||
|
import app.revanced.manager.util.resetListItemColorsCached
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class GeneralSettingsViewModel(
|
class GeneralSettingsViewModel(
|
||||||
@ -11,5 +12,6 @@ class GeneralSettingsViewModel(
|
|||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
fun setTheme(theme: Theme) = viewModelScope.launch {
|
fun setTheme(theme: Theme) = viewModelScope.launch {
|
||||||
prefs.theme.update(theme)
|
prefs.theme.update(theme)
|
||||||
|
resetListItemColorsCached()
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -180,6 +180,10 @@ fun LocalDateTime.relativeTime(context: Context): String {
|
|||||||
|
|
||||||
private var transparentListItemColorsCached: ListItemColors? = null
|
private var transparentListItemColorsCached: ListItemColors? = null
|
||||||
|
|
||||||
|
fun resetListItemColorsCached() {
|
||||||
|
transparentListItemColorsCached = null
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default ListItem colors, but with [ListItemColors.containerColor] set to [Color.Transparent].
|
* The default ListItem colors, but with [ListItemColors.containerColor] set to [Color.Transparent].
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user