aboutsummaryrefslogtreecommitdiff
path: root/library/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-02 12:43:54 -0700
committerAllan Wang <me@allanwang.ca>2017-07-02 12:43:54 -0700
commitf4090285eb82a46cd7f99df4d2c606e3eb723154 (patch)
tree562a11b69a9cebf3a9db825222fa41641c9e59d6 /library/src
parentcec534db775f0fad2fc096fc353f0367e6fcb24b (diff)
downloadkau-f4090285eb82a46cd7f99df4d2c606e3eb723154.tar.gz
kau-f4090285eb82a46cd7f99df4d2c606e3eb723154.tar.bz2
kau-f4090285eb82a46cd7f99df4d2c606e3eb723154.zip
Return snackbar upon creation
Diffstat (limited to 'library/src')
-rw-r--r--library/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt b/library/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt
index 7fa7c0e..d17a11f 100644
--- a/library/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt
+++ b/library/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt
@@ -48,10 +48,11 @@ import com.mikepenz.iconics.typeface.IIcon
@KauUtils fun View.isInvisible(): Boolean = visibility == View.INVISIBLE
@KauUtils fun View.isGone(): Boolean = visibility == View.GONE
-fun View.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}) {
+fun View.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}): Snackbar {
val snackbar = Snackbar.make(this, text, duration)
snackbar.builder()
snackbar.show()
+ return snackbar
}
fun View.snackbar(@StringRes textId: Int, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {})