mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 13:05:37 +02:00
Resetting cached transparent color on theme update
This commit is contained in:
parent
5555373deb
commit
3aa24fbbc1
2 changed files with 6 additions and 0 deletions
|
@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
|
|||
import androidx.lifecycle.viewModelScope
|
||||
import app.revanced.manager.domain.manager.PreferencesManager
|
||||
import app.revanced.manager.ui.theme.Theme
|
||||
import app.revanced.manager.util.resetCachedTransparentColor
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class GeneralSettingsViewModel(
|
||||
|
@ -11,5 +12,6 @@ class GeneralSettingsViewModel(
|
|||
) : ViewModel() {
|
||||
fun setTheme(theme: Theme) = viewModelScope.launch {
|
||||
prefs.theme.update(theme)
|
||||
resetCachedTransparentColor()
|
||||
}
|
||||
}
|
|
@ -180,6 +180,10 @@ fun LocalDateTime.relativeTime(context: Context): String {
|
|||
|
||||
private var transparentListItemColorsCached: ListItemColors? = null
|
||||
|
||||
fun resetCachedTransparentColor() {
|
||||
transparentListItemColorsCached = null
|
||||
}
|
||||
|
||||
/**
|
||||
* The default ListItem colors, but with [ListItemColors.containerColor] set to [Color.Transparent].
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue