aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin/ca
diff options
context:
space:
mode:
Diffstat (limited to 'sample/src/main/kotlin/ca')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt1
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt9
2 files changed, 9 insertions, 1 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt
index a0fbc59..1bbcc47 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt
@@ -15,4 +15,5 @@ object KPrefSample : KPref() {
var check2: Boolean by kpref("check2", false)
var check3: Boolean by kpref("check3", false)
var text: String by kpref("text", "empty")
+ var seekbar: Int by kpref("seekbar", 20)
} \ No newline at end of file
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 899a50e..e63f107 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -143,6 +143,13 @@ class MainActivity : KPrefActivity() {
}
}
+ seekbar(R.string.seekbar, { KPrefSample.seekbar }, { KPrefSample.seekbar = it }) {
+ descRes = R.string.kau_lorem_ipsum
+ textViewConfigs = {
+ minEms = 2
+ }
+ }
+
subItems(R.string.sub_item, subPrefs()) {
descRes = R.string.sub_item_desc
}
@@ -158,7 +165,7 @@ class MainActivity : KPrefActivity() {
}
fun subPrefs(): KPrefAdapterBuilder.() -> Unit = {
- text<String>(R.string.text, { KPrefSample.text }, { KPrefSample.text = it }) {
+ text(R.string.text, { KPrefSample.text }, { KPrefSample.text = it }) {
descRes = R.string.text_desc
onClick = {
itemView, _, item ->