Skip to content

Instantly share code, notes, and snippets.

@Shivamdhuria
Created May 30, 2020 19:00
Show Gist options
  • Save Shivamdhuria/59798539d65550a20549e1d9eb8ffa78 to your computer and use it in GitHub Desktop.
Save Shivamdhuria/59798539d65550a20549e1d9eb8ffa78 to your computer and use it in GitHub Desktop.
private fun toggleTheme(isDark: Boolean): Boolean {
val mode = when (isDark) {
true -> LIGHT_MODE
false -> DARK_MODE
}
ThemeManager.applyTheme(mode)
preferenceManager.saveThemePreference(mode)
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment