mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-21 15:05:19 +00:00
Move invalidateComposeThemeColors()
This commit is contained in:
parent
447ea85333
commit
ce501fd363
@ -6,7 +6,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import org.session.libsession.utilities.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.ui.theme.cachedColorsProvider
|
||||
import org.thoughtcrime.securesms.ui.theme.invalidateComposeThemeColors
|
||||
import org.thoughtcrime.securesms.util.ThemeState
|
||||
import org.thoughtcrime.securesms.util.themeState
|
||||
import javax.inject.Inject
|
||||
@ -17,11 +17,6 @@ class AppearanceSettingsViewModel @Inject constructor(private val prefs: TextSec
|
||||
private val _uiState = MutableStateFlow(prefs.themeState())
|
||||
val uiState: StateFlow<ThemeState> = _uiState
|
||||
|
||||
fun invalidateComposeThemeColors() {
|
||||
// invalidate compose theme colors
|
||||
cachedColorsProvider = null
|
||||
}
|
||||
|
||||
fun setNewAccent(@StyleRes newAccentColorStyle: Int) {
|
||||
prefs.setAccentColorStyle(newAccentColorStyle)
|
||||
// update UI state
|
||||
|
@ -22,6 +22,11 @@ val LocalType = compositionLocalOf { sessionTypography }
|
||||
|
||||
var cachedColorsProvider: ThemeColorsProvider? = null
|
||||
|
||||
fun invalidateComposeThemeColors() {
|
||||
// invalidate compose theme colors
|
||||
cachedColorsProvider = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply a Material2 compose theme based on user selections in SharedPreferences.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user