From e6ec9c5dd677be298430cb2b694f047c67b03239 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 9 Jul 2017 11:28:59 -0700 Subject: KAU 2.0 (#1) - Update docs and finish up refractoring * Update readme * Add docs for remaining submodules * Update searchview * Update links 1/3 * Update links 2/3 * Update links 3/3 * update changelog * Update readme * Test rename to readme * Rename remaining to readme * Link readme to repo --- core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt index 58e570f..6c0b608 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt @@ -40,8 +40,11 @@ class KPrefSingleDelegate internal constructor(private val key: String, private _v2 } else { _value = pref.sp.getBoolean(key, true) - if (_value!!) pref.sp.edit().putBoolean(key, false).apply() - _value!! + if (_value!!) { + pref.sp.edit().putBoolean(key, false).apply() + _value = false + true + } else false } } } -- cgit v1.2.3