Skip to content

Instantly share code, notes, and snippets.

View ND1010's full-sized avatar

Dhruv Nirmal ND1010

  • Easy Pay private limited
  • ahmedabad
View GitHub Profile
@ND1010
ND1010 / MyPreferences.kt
Created September 4, 2018 13:03 — forked from LouisCAD/MyPreferences.kt
Make Android's SharedPreferences as simple as a field in kotlin.
package com.mypackage.myapp.prefs
import android.content.Context
import com.mypackage.myapp.appCtx
object MyPreferences : Preferences(name = "MyPrefsFileName") {
var userWantsFancyUi by BoolPref(Keys.FANCY_UI, false)
var isFcmTokenSent by BoolPref(Keys.FCM_TOKEN_SENT_TO_SERVER, false)
var eggTapsCount by LongPref(Keys.EGG_TAPS_COUNT, 0L)