aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-06-07 16:13:51 -0400
committerGitHub <noreply@github.com>2019-06-07 16:13:51 -0400
commit065f2db88e4b87b53b3216a5313d5e1e22fa2867 (patch)
treed03866b74ef8146dbd900d20994de47a0de6c705 /core
parenteb9317015c6535bfa36166d254ec954f81d8df97 (diff)
parentd30cdac9ca74ca5e202c681af228fa4ca3a8e389 (diff)
downloadkau-065f2db88e4b87b53b3216a5313d5e1e22fa2867.tar.gz
kau-065f2db88e4b87b53b3216a5313d5e1e22fa2867.tar.bz2
kau-065f2db88e4b87b53b3216a5313d5e1e22fa2867.zip
Merge pull request #202 from AllanWang/plugin-object
Plugin object
Diffstat (limited to 'core')
-rw-r--r--core/build.gradle22
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt9
2 files changed, 17 insertions, 14 deletions
diff --git a/core/build.gradle b/core/build.gradle
index 3ac4f36..43cdc6d 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -1,22 +1,22 @@
-ext.kauSubModuleMinSdk = kau.coreMinSdk
+ext.kauSubModuleMinSdk = kau.Versions.coreMinSdk
apply from: '../android-lib.gradle'
dependencies {
- api kauDependency.kotlin
+ api kau.Dependencies.kotlin
- api "androidx.appcompat:appcompat:${kau.appcompat}"
- api "androidx.recyclerview:recyclerview:${kau.recyclerView}"
- api "androidx.cardview:cardview:${kau.cardView}"
- api "androidx.constraintlayout:constraintlayout:${kau.constraintLayout}"
- api "com.google.android.material:material:${kau.googleMaterial}"
+ api "androidx.appcompat:appcompat:${kau.Versions.appcompat}"
+ api "androidx.recyclerview:recyclerview:${kau.Versions.recyclerView}"
+ api "androidx.cardview:cardview:${kau.Versions.cardView}"
+ api "androidx.constraintlayout:constraintlayout:${kau.Versions.constraintLayout}"
+ api "com.google.android.material:material:${kau.Versions.googleMaterial}"
- api "org.jetbrains.kotlinx:kotlinx-coroutines-android:${kau.coroutines}"
+ api "org.jetbrains.kotlinx:kotlinx-coroutines-android:${kau.Versions.coroutines}"
- api "com.mikepenz:iconics-core:${kau.iconics}@aar"
- api "com.mikepenz:google-material-typeface:${kau.iconicsGoogle}.original@aar"
+ api "com.mikepenz:iconics-core:${kau.Versions.iconics}@aar"
+ api "com.mikepenz:google-material-typeface:${kau.Versions.iconicsGoogle}.original@aar"
- api "com.afollestad.material-dialogs:core:${kau.materialDialog}"
+ api "com.afollestad.material-dialogs:core:${kau.Versions.materialDialog}"
}
apply from: '../artifacts.gradle'
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt
index 82d5608..e8680dc 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt
@@ -203,12 +203,15 @@ fun Context.resolveString(@AttrRes attr: Int, fallback: String = ""): String {
inline fun Context.materialDialog(
dialogBehavior: DialogBehavior = ModalDialog,
action: MaterialDialog.() -> Unit
-) {
+): MaterialDialog {
val dialog = MaterialDialog(this, dialogBehavior)
+ dialog.action()
if (isFinishing) {
- return KL.d { "Material Dialog triggered from finishing context; did not show" }
+ KL.d { "Material Dialog triggered from finishing context; did not show" }
+ } else {
+ dialog.show()
}
- dialog.show(action)
+ return dialog
}
fun Context.getDip(value: Float): Float =