Created
December 7, 2022 12:32
-
-
Save MrNtlu/a781d838519c17204bb83c0c1603b447 to your computer and use it in GitHub Desktop.
Jetpack Compose Dark Theme ViewModel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThemeViewModel: ViewModel() { | |
var isDarkThemeEnabled = mutableStateOf(false) | |
private set | |
fun setTheme(isDarkTheme: Boolean) { | |
isDarkThemeEnabled.value = isDarkTheme | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment