Skip to content

Instantly share code, notes, and snippets.

@vamsitallapudi
Created December 13, 2020 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vamsitallapudi/c0a0d5514216c2dff3e744f1f7959300 to your computer and use it in GitHub Desktop.
Save vamsitallapudi/c0a0d5514216c2dff3e744f1f7959300 to your computer and use it in GitHub Desktop.
class PrefLocalDataSourceImpl(val context: Context) : PrefRepo {
override fun updateDarkMode(enabled: Boolean) {
val sharedPreferences = context.getSharedPreferences("darkModePref", Context.MODE_PRIVATE)
val editor = sharedPreferences.edit()
editor.putBoolean("darkMode", true)
editor.apply()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment