Kotlin create a snackbar
In Kotlin like so
Snackbar.make(binding.root, "My Message", Snackbar.LENGTH_SHORT).show()
Refer this for more details
and then here's your modified code which will show snack bar
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()
}