-
-
Save egorikftp/b12c007a04da8cbe4f6af2a0085dff06 to your computer and use it in GitHub Desktop.
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
enum class Theme(val storageKey: String) { | |
LIGHT("light"), | |
DARK("dark"), | |
SYSTEM("system") | |
} | |
private val prefs: SharedPreferences = | |
context.getSharedPreferences("PREFERENCES_NAME", Context.MODE_PRIVATE) | |
var theme by StringPreference( | |
preferences = prefs, | |
name = "pref_dark_mode", | |
defaultValue = SYSTEM.storageKey | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment