diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-07 13:48:15 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-07 13:48:15 -0700 |
commit | dfda38f585f609a4a0df4b5f21948d6222965b56 (patch) | |
tree | a42982ee38c8d6fad83bc927b3055aef789bd987 /sample/src/main/kotlin/ca | |
parent | 0a635fd19a1673d534d57e76f270981766cf6a2b (diff) | |
download | kau-dfda38f585f609a4a0df4b5f21948d6222965b56.tar.gz kau-dfda38f585f609a4a0df4b5f21948d6222965b56.tar.bz2 kau-dfda38f585f609a4a0df4b5f21948d6222965b56.zip |
Create seekbar prefs
Diffstat (limited to 'sample/src/main/kotlin/ca')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt | 1 | ||||
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 9 |
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 -> |