Skip to content

Instantly share code, notes, and snippets.

@MrNtlu
Created December 7, 2022 12:32
Show Gist options
  • Save MrNtlu/a781d838519c17204bb83c0c1603b447 to your computer and use it in GitHub Desktop.
Save MrNtlu/a781d838519c17204bb83c0c1603b447 to your computer and use it in GitHub Desktop.
Jetpack Compose Dark Theme ViewModel
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