diff options
author | Allan Wang <me@allanwang.ca> | 2019-06-07 09:39:33 -0400 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-06-07 09:39:33 -0400 |
commit | d6a61d5b2601b3849bf402e48fcf1c50a32cfcab (patch) | |
tree | 745ed921423e572c8bff8da6dc08db5ec115115b /sample/src/main/kotlin | |
parent | b9feba20d45505a22162c386e18dfc1a4f117d3f (diff) | |
download | kau-d6a61d5b2601b3849bf402e48fcf1c50a32cfcab.tar.gz kau-d6a61d5b2601b3849bf402e48fcf1c50a32cfcab.tar.bz2 kau-d6a61d5b2601b3849bf402e48fcf1c50a32cfcab.zip |
Begin initial md port
Diffstat (limited to 'sample/src/main/kotlin')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 27 |
1 files changed, 15 insertions, 12 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 d4a30bb..d9586c4 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -38,6 +38,7 @@ import ca.allanwang.kau.utils.string import ca.allanwang.kau.utils.toast import ca.allanwang.kau.utils.withSceneTransitionAnimation import ca.allanwang.kau.xml.showChangelog +import com.afollestad.materialdialogs.input.input import com.mikepenz.google_material_typeface_library.GoogleMaterial class MainActivity : KPrefActivity() { @@ -162,9 +163,10 @@ class MainActivity : KPrefActivity() { descRes = R.string.text_desc onClick = { itemView.context.materialDialog { - title("Type Text") - input("Type here", item.pref, { _, input -> item.pref = input.toString() }) - inputRange(0, 20) + title(text = "Type Text") + input("Type here", prefill = item.pref, maxLength = 20, allowEmpty = true) { _, input -> + item.pref = input.toString() + } } } } @@ -240,12 +242,11 @@ class MainActivity : KPrefActivity() { descRes = R.string.text_desc onClick = { itemView.context.materialDialog { - title("Type Text") - input("Type here", item.pref) { _, input -> + title(text = "Type Text") + input("Type here", prefill = item.pref, maxLength = 20, allowEmpty = true) { _, input -> item.pref = input.toString() reloadSelf() } - inputRange(0, 20) } } } @@ -260,9 +261,10 @@ class MainActivity : KPrefActivity() { KPrefSample.version = BuildConfig.VERSION_CODE if (!BuildConfig.DEBUG) showChangelog(R.xml.kau_changelog, KPrefSample.textColor) { - titleColor(KPrefSample.textColor) - backgroundColor(KPrefSample.bgColor) - positiveColor(KPrefSample.accentColor) + // TODO MD Color +// titleColor(KPrefSample.textColor) +// backgroundColor(KPrefSample.bgColor) +// positiveColor(KPrefSample.accentColor) } } supportActionBar?.apply { @@ -297,9 +299,10 @@ class MainActivity : KPrefActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_changelog -> showChangelog(R.xml.kau_changelog, KPrefSample.textColor) { - titleColor(KPrefSample.textColor) - backgroundColor(KPrefSample.bgColor) - positiveColor(KPrefSample.accentColor) + // TODO MD Color +// titleColor(KPrefSample.textColor) +// backgroundColor(KPrefSample.bgColor) +// positiveColor(KPrefSample.accentColor) } R.id.action_settings -> startActivity<AnimActivity>() R.id.action_email -> sendEmail(R.string.your_email, R.string.your_subject) |