aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin/ca
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-01-20 21:59:35 -0500
committerAllan Wang <me@allanwang.ca>2018-01-20 21:59:35 -0500
commit28c07ba66bf71dd322ffe3253b35862cdfc82e98 (patch)
tree029cfea22b556c91ab2c1e4daa28fe59e425b781 /sample/src/main/kotlin/ca
parent097d2e0a393294bb239a2455a9a75a405a220fad (diff)
downloadkau-28c07ba66bf71dd322ffe3253b35862cdfc82e98.tar.gz
kau-28c07ba66bf71dd322ffe3253b35862cdfc82e98.tar.bz2
kau-28c07ba66bf71dd322ffe3253b35862cdfc82e98.zip
Update kpref-activity encapsulation and internals
Diffstat (limited to 'sample/src/main/kotlin/ca')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt7
1 files changed, 6 insertions, 1 deletions
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
}