Created
October 25, 2021 13:22
-
-
Save Sardorbekcyber/052023e8f3d6af666230026e90c556c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun View.snack( | |
@StringRes messageRes: Int, | |
length: Int = Snackbar.LENGTH_LONG, | |
f: Snackbar.() -> Unit | |
) { | |
snack(resources.getString(messageRes), length, f) | |
} | |
inline fun View.snack(message: String, length: Int = Snackbar.LENGTH_LONG, f: Snackbar.() -> Unit) { | |
val snack = Snackbar.make(this, message, length) | |
snack.f() | |
snack.show() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment