Created
June 1, 2020 20:10
-
-
Save manuelernesto/bd24d362a8c5e9f89935823e3f4da455 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
class MyPreferences(context: Context?) { | |
companion object { | |
private const val DARK_STATUS = "io.github.manuelernesto.DARK_STATUS" | |
} | |
private val preferences = PreferenceManager.getDefaultSharedPreferences(context) | |
var darkMode = preferences.getInt(DARK_STATUS, 0) | |
set(value) = preferences.edit().putInt(DARK_STATUS, value).apply() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment