diff options
author | Allan Wang <me@allanwang.ca> | 2017-05-29 19:47:52 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-05-29 19:47:52 -0700 |
commit | 461425eb6054f18cea1990a4117fe8c78e888ddf (patch) | |
tree | 98c8d84cfb231479cf88c3cc413b7c4a8366e42b /app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | |
parent | e33120d454aeb72acc2c1315bddea31dd2f15bb2 (diff) | |
download | frost-461425eb6054f18cea1990a4117fe8c78e888ddf.tar.gz frost-461425eb6054f18cea1990a4117fe8c78e888ddf.tar.bz2 frost-461425eb6054f18cea1990a4117fe8c78e888ddf.zip |
Add icon tabs and webview observables
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 | 4 |
1 files changed, 2 insertions, 2 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 c98fd5a5..fc2e9d1c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -13,6 +13,8 @@ class Prefs(c: android.content.Context) { val LAST_ACTIVE = "last_active" } + private val prefs: android.content.SharedPreferences by lazy { c.getSharedPreferences(com.pitchedapps.frost.utils.Prefs.Companion.PREFERENCE_NAME, android.content.Context.MODE_PRIVATE) } + var lastActive: Long get() = prefs.getLong(com.pitchedapps.frost.utils.Prefs.Companion.LAST_ACTIVE, -1) set(value) = set(com.pitchedapps.frost.utils.Prefs.Companion.LAST_ACTIVE, System.currentTimeMillis()) @@ -21,8 +23,6 @@ class Prefs(c: android.content.Context) { lastActive = 0 } - private val prefs: android.content.SharedPreferences by lazy { c.getSharedPreferences(com.pitchedapps.frost.utils.Prefs.Companion.PREFERENCE_NAME, android.content.Context.MODE_PRIVATE) } - private fun set(key: String, value: Boolean) = prefs.edit().putBoolean(key, value).apply() private fun set(key: String, value: Int) = prefs.edit().putInt(key, value).apply() private fun set(key: String, value: Long) = prefs.edit().putLong(key, value).apply() |