diff options
author | Allan Wang <me@allanwang.ca> | 2017-05-30 17:26:14 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-05-30 17:26:14 -0700 |
commit | 20ef6500dc0b6d84905d92d8469feb6ff0ac502d (patch) | |
tree | 89a8d9a5132fee000aa2fa6ef641905239c38106 /app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | |
parent | 4c44dbc9933bd726c1da0bf326102835c4974d6b (diff) | |
download | frost-20ef6500dc0b6d84905d92d8469feb6ff0ac502d.tar.gz frost-20ef6500dc0b6d84905d92d8469feb6ff0ac502d.tar.bz2 frost-20ef6500dc0b6d84905d92d8469feb6ff0ac502d.zip |
migrate to dbflow
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt index ad222145..710da845 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -17,6 +17,7 @@ object Prefs { lateinit private var c: Context operator fun invoke(c: Context) { this.c = c + lastActive = 0 } private val sp: SharedPreferences by lazy { c.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE) } @@ -25,10 +26,6 @@ object Prefs { get() = sp.getLong(LAST_ACTIVE, -1) set(value) = set(LAST_ACTIVE, System.currentTimeMillis()) - init { - lastActive = 0 - } - private fun set(key: String, value: Boolean) = sp.edit().putBoolean(key, value).apply() private fun set(key: String, value: Int) = sp.edit().putInt(key, value).apply() private fun set(key: String, value: Long) = sp.edit().putLong(key, value).apply() |