aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-23 17:45:54 -0700
committerAllan Wang <me@allanwang.ca>2017-06-23 17:45:54 -0700
commit9e31fdd4f15ec65cfd272fb1e814bfe0461f0d4f (patch)
tree2427336ce786a745321865be1e30de629007656a /sample/src/main/kotlin/ca/allanwang
parent0df43d971f1eb18a0e6ce7fa56fab11dfba154b8 (diff)
downloadkau-9e31fdd4f15ec65cfd272fb1e814bfe0461f0d4f.tar.gz
kau-9e31fdd4f15ec65cfd272fb1e814bfe0461f0d4f.tar.bz2
kau-9e31fdd4f15ec65cfd272fb1e814bfe0461f0d4f.zip
Add plain text kpref
Diffstat (limited to 'sample/src/main/kotlin/ca/allanwang')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt13
1 files changed, 6 insertions, 7 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 460d993..2914824 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -7,7 +7,10 @@ import ca.allanwang.kau.email.sendEmail
import ca.allanwang.kau.kpref.CoreAttributeContract
import ca.allanwang.kau.kpref.KPrefActivity
import ca.allanwang.kau.kpref.KPrefAdapterBuilder
-import ca.allanwang.kau.utils.*
+import ca.allanwang.kau.utils.materialDialog
+import ca.allanwang.kau.utils.navigationBarColor
+import ca.allanwang.kau.utils.startActivity
+import ca.allanwang.kau.utils.toast
import ca.allanwang.kau.views.RippleCanvas
import com.mikepenz.google_material_typeface_library.GoogleMaterial
@@ -73,17 +76,13 @@ class MainActivity : KPrefActivity() {
allowCustom = true
}
- 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 ->
itemView.context.materialDialog {
title("Type Text")
- input("Type here", item.pref, {
- _, input ->
- item.pref = input.toString()
- reloadSelf()
- })
+ input("Type here", item.pref, { _, input -> item.pref = input.toString() })
inputRange(0, 20)
}
true