Very easy:

Snackbar.make(button, warning, Snackbar.LENGTH_INDEFINITE)
                    .setAction(android.R.string.ok) { button.isEnabled = true }
                    .setActionTextColor(resources.getColor(android.R.color.holo_red_light, null))
                    .apply { view.findViewById<TextView>(com.google.android.material.R.id.snackbar_text).maxLines = 5 }
                    .show()

Leave a Reply