From 9e31fdd4f15ec65cfd272fb1e814bfe0461f0d4f Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 23 Jun 2017 17:45:54 -0700 Subject: Add plain text kpref --- .../src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sample/src') 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(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 -- cgit v1.2.3