aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-09-26 09:53:48 -0400
committerAllan Wang <me@allanwang.ca>2018-09-26 09:53:48 -0400
commit101e025f37828a9e4100dde899fc03e0a6054aac (patch)
tree9798b8bb1ebe4edc5bc63db94ab621e7e6a2889c /core/src/main/kotlin/ca
parentf37d7782b7d0269755348b41bfa63dbd50593a6b (diff)
downloadkau-101e025f37828a9e4100dde899fc03e0a6054aac.tar.gz
kau-101e025f37828a9e4100dde899fc03e0a6054aac.tar.bz2
kau-101e025f37828a9e4100dde899fc03e0a6054aac.zip
Deprecate kpref double
Diffstat (limited to 'core/src/main/kotlin/ca')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt
index 9dbca49..2630884 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt
@@ -9,6 +9,9 @@ fun KPref.kpref(key: String, fallback: Boolean, postSetter: (value: Boolean) ->
fun KPref.kpref(key: String, fallback: Float, postSetter: (value: Float) -> Unit = {}) =
KPrefDelegate(key, fallback, this, KPrefFloatTransaction, postSetter)
+@Deprecated("Double is not supported in SharedPreferences; cast to float yourself",
+ ReplaceWith("kpref(key, fallback.toFloat(), postSetter)"),
+ DeprecationLevel.WARNING)
fun KPref.kpref(key: String, fallback: Double, postSetter: (value: Float) -> Unit = {}) =
kpref(key, fallback.toFloat(), postSetter)