From 28c07ba66bf71dd322ffe3253b35862cdfc82e98 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 20 Jan 2018 21:59:35 -0500 Subject: Update kpref-activity encapsulation and internals --- sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sample/src/main') diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt index b27a713..91def54 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -184,7 +184,12 @@ class MainActivity : KPrefActivity() { header(R.string.long_prefs) - checkbox(R.string.checkbox_3, { KPrefSample.check2 }, { KPrefSample.check2 = it; reloadByTitle(R.string.checkbox_3) }) { + /** + * Showcases a little trick. The id for reloading is [R.string.checkbox_2], + * but the title displayed is still [R.string.checkbox_3] + */ + checkbox(R.string.checkbox_2, { KPrefSample.check2 }, { KPrefSample.check2 = it; reloadByTitle(R.string.checkbox_3) }) { + titleFun = { R.string.checkbox_3 } descRes = R.string.kau_lorem_ipsum } -- cgit v1.2.3