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 | |
parent | 0a635fd19a1673d534d57e76f270981766cf6a2b (diff) | |
download | kau-dfda38f585f609a4a0df4b5f21948d6222965b56.tar.gz kau-dfda38f585f609a4a0df4b5f21948d6222965b56.tar.bz2 kau-dfda38f585f609a4a0df4b5f21948d6222965b56.zip |
Create seekbar prefs
Diffstat (limited to 'sample/src/main')
4 files changed, 17 insertions, 3 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 -> diff --git a/sample/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml index a2f1b58..0be46ec 100644 --- a/sample/src/main/res/values/strings.xml +++ b/sample/src/main/res/values/strings.xml @@ -15,6 +15,7 @@ <string name="color_custom_alpha">This selector allows for custom colors with alpha values</string> <string name="text">Text Pref</string> <string name="text_desc">Saves the text</string> + <string name="seekbar">Seekbar</string> <string name="sub_item">Sub Item Pref</string> <string name="sub_item_desc">Press this to view the next subset of preferences</string> <string name="your_email">your.email@here.com</string> diff --git a/sample/src/main/res/xml/changelog.xml b/sample/src/main/res/xml/changelog.xml index 7801511..7d79ad5 100644 --- a/sample/src/main/res/xml/changelog.xml +++ b/sample/src/main/res/xml/changelog.xml @@ -6,6 +6,13 @@ <item text="" /> --> + <version title="v1.6"/> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <version title="v1.5"/> <item text="Change snackbar builder" /> <item text="Change addBundle to withArguments to match ANKO" /> @@ -13,8 +20,6 @@ <item text="Create permission manager and permission constants" /> <item text="Create swipe, a very simple helper to allow for activities to be dismissed with gestures" /> <item text="Create network utils" /> - <item text="" /> - <item text="" /> <version title="v1.4"/> <item text="Add about activities" /> |