diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-26 04:01:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-26 04:01:23 -0500 |
commit | 7a3165ac7404381eb85ea40525db1a7a7d980761 (patch) | |
tree | 2341ea4ef0488b9abeea1fbe70697705d295aeb2 /sample/src/main/kotlin/ca | |
parent | fb9ca21757068c0fb4123a5e30b1471ae4c32cf3 (diff) | |
download | kau-7a3165ac7404381eb85ea40525db1a7a7d980761.tar.gz kau-7a3165ac7404381eb85ea40525db1a7a7d980761.tar.bz2 kau-7a3165ac7404381eb85ea40525db1a7a7d980761.zip |
Update/kpref activity (#113)
* Revamp kpref
* Clean up data
* Fix script
* Test emulator
* Test google api
* Test again
* Test gpg
* Update dependencies
Diffstat (limited to 'sample/src/main/kotlin/ca')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 24 |
1 files changed, 9 insertions, 15 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 dd81ce1..e735b38 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -107,10 +107,7 @@ class MainActivity : KPrefActivity() { checkbox(R.string.checkbox_3, { KPrefSample.check3 }, { KPrefSample.check3 = it }) { descRes = R.string.desc_dependent enabler = { KPrefSample.check2 } - onDisabledClick = { itemView, _, _ -> - itemView.context.toast("I am still disabled") - true - } + onDisabledClick = { itemView.context.toast("I am still disabled") } } colorPicker(R.string.text_color, { KPrefSample.textColor }, { KPrefSample.textColor = it; reload() }) { @@ -139,13 +136,13 @@ class MainActivity : KPrefActivity() { text(R.string.text, { KPrefSample.text }, { KPrefSample.text = it }) { descRes = R.string.text_desc - onClick = { itemView, _, item -> + onClick = { itemView.context.materialDialog { title("Type Text") input("Type here", item.pref, { _, input -> item.pref = input.toString() }) inputRange(0, 20) } - true + } } @@ -161,28 +158,26 @@ class MainActivity : KPrefActivity() { } plainText(R.string.swipe_showcase) { - onClick = { _, _, _ -> startActivityWithEdge(SWIPE_EDGE_LEFT); false } + onClick = { startActivityWithEdge(SWIPE_EDGE_LEFT) } } plainText(R.string.image_showcase) { - onClick = { _, _, _ -> kauLaunchMediaPicker(ImagePickerActivity::class.java, REQUEST_MEDIA); false } + onClick = { kauLaunchMediaPicker(ImagePickerActivity::class.java, REQUEST_MEDIA) } } plainText(R.string.video_overlay_showcase) { - onClick = { _, _, _ -> kauLaunchMediaPicker(VideoPickerActivityOverlay::class.java, REQUEST_MEDIA); false } + onClick = { kauLaunchMediaPicker(VideoPickerActivityOverlay::class.java, REQUEST_MEDIA) } } plainText(R.string.adapter_showcase) { - onClick = { _, _, _ -> - startActivity(AdapterActivity::class.java, bundleBuilder = { + onClick = { startActivity(AdapterActivity::class.java, bundleBuilder = { withSceneTransitionAnimation(this@MainActivity) }) - false } } plainText(R.string.kau_about_app) { - onClick = { _, _, _ -> kauLaunchAbout(AboutActivity::class.java); false } + onClick = { kauLaunchAbout(AboutActivity::class.java) } } header(R.string.long_prefs) @@ -211,7 +206,7 @@ class MainActivity : KPrefActivity() { fun subPrefs(): KPrefAdapterBuilder.() -> Unit = { text(R.string.text, { KPrefSample.text }, { KPrefSample.text = it }) { descRes = R.string.text_desc - onClick = { itemView, _, item -> + onClick = { itemView.context.materialDialog { title("Type Text") input("Type here", item.pref, { _, input -> @@ -220,7 +215,6 @@ class MainActivity : KPrefActivity() { }) inputRange(0, 20) } - true } } } |