diff options
Diffstat (limited to 'core/src/main/kotlin/ca')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt | 3 |
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) |