aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-07 13:48:15 -0700
committerAllan Wang <me@allanwang.ca>2017-07-07 13:48:15 -0700
commitdfda38f585f609a4a0df4b5f21948d6222965b56 (patch)
treea42982ee38c8d6fad83bc927b3055aef789bd987 /sample/src/main/kotlin
parent0a635fd19a1673d534d57e76f270981766cf6a2b (diff)
downloadkau-dfda38f585f609a4a0df4b5f21948d6222965b56.tar.gz
kau-dfda38f585f609a4a0df4b5f21948d6222965b56.tar.bz2
kau-dfda38f585f609a4a0df4b5f21948d6222965b56.zip
Create seekbar prefs
Diffstat (limited to 'sample/src/main/kotlin')
-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 ->