Answers for "snackbar with action button kotlin"

1

Snackbar android example Kotlin

fun onSNACK(view: View){
    //Snackbar(view)
    val snackbar = Snackbar.make(view, "Replace with your own action",
            Snackbar.LENGTH_LONG).setAction("Action", null)
    snackbar.setActionTextColor(Color.BLUE)
    val snackbarView = snackbar.view
    snackbarView.setBackgroundColor(Color.LTGRAY)
    val textView =
            snackbarView.findViewById(com.google.android.material.R.id.snackbar_text) as TextView
    textView.setTextColor(Color.BLUE)
    textView.textSize = 28f
    snackbar.show()
}
Posted by: Guest on November-09-2021
-1

snackbar kotlin

//Simple Snackbar
Snackbar.makeView(view, "Example Text", Snackbar.LENGTH_LONG),show()
//Snackbar.LENGTH_LONG or LENGTH_SHORT
Posted by: Guest on August-01-2021

Code answers related to "snackbar with action button kotlin"

Browse Popular Code Answers by Language