aboutsummaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-06-07 12:41:13 -0400
committerGitHub <noreply@github.com>2019-06-07 12:41:13 -0400
commit1e3cb74579a3297460cd4085c57942138c5805a2 (patch)
treeba1ab2f42d3d4407c50c215ba85674700c047db7 /sample
parentb9feba20d45505a22162c386e18dfc1a4f117d3f (diff)
parent879ac366074697dd0a7fbb2c3d99a48d7aeeb22d (diff)
downloadkau-1e3cb74579a3297460cd4085c57942138c5805a2.tar.gz
kau-1e3cb74579a3297460cd4085c57942138c5805a2.tar.bz2
kau-1e3cb74579a3297460cd4085c57942138c5805a2.zip
Merge pull request #200 from AllanWang/material-dialogs-3
Material Dialogs 3
Diffstat (limited to 'sample')
-rw-r--r--sample/build.gradle2
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt27
-rw-r--r--sample/src/main/res/xml/kau_changelog.xml8
3 files changed, 25 insertions, 12 deletions
diff --git a/sample/build.gradle b/sample/build.gradle
index 7316f1e..bb7cab0 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -122,6 +122,8 @@ dependencies {
implementation project(':searchview')
implementation project(':mediapicker')
+ implementation "com.afollestad.material-dialogs:input:${kau.materialDialog}"
+
testImplementation kauDependency.kotlinTest
testImplementation kauDependency.junit
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)
diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml
index 0b13dd4..53265d0 100644
--- a/sample/src/main/res/xml/kau_changelog.xml
+++ b/sample/src/main/res/xml/kau_changelog.xml
@@ -6,6 +6,14 @@
<item text="" />
-->
+ <version title="v5.0.0" />
+ <item text=":core: Update Material Dialogs to 3.x" />
+ <item text=":colorpicker: Strip down to just the interface; unless you require the accent palette, it may be fine to just use MD's color extension" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+
<version title="v4.1.0" />
<item text=":core: Deprecate NetworkUtils, as the underlying functions are deprecated" />
<item text=":core: Permission manager no longer synchronized, as all actions should occur in the main thread" />