From 101e025f37828a9e4100dde899fc03e0a6054aac Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 26 Sep 2018 09:53:48 -0400 Subject: Deprecate kpref double --- core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/src/main') 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) -- cgit v1.2.3