Created
March 2, 2023 06:13
-
-
Save akshaykalola28/0aa60dd8355ce107c9c49e7281cbf096 to your computer and use it in GitHub Desktop.
Kotlin extenstion for snackbar visibility for android view
This file contains 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
import android.view.View | |
import androidx.annotation.StringRes | |
import com.google.android.material.snackbar.Snackbar | |
fun View.snackbar(message: String, duration: Int = Snackbar.LENGTH_LONG) { | |
Snackbar.make(this, message, duration).show() | |
} | |
fun View.snackbar(@StringRes message: Int, duration: Int = Snackbar.LENGTH_LONG) { | |
Snackbar.make(this, message, duration).show() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment