I\'m updating my current app to use snackbars, in the Google spec they show various ways of using them http://www.google.com/design/spec/components/snackbars-toasts.html#sna
My solution in Kotlin extension:
fun showSnackBarWithConfirmation(text: String, view: View, action: () -> Unit) =
Snackbar.make(view, text, Snackbar.LENGTH_LONG).apply {
this.view.findViewById(R.id.snackbar_text)
.setTextColor(view.context.color(R.color.colorBackgroundLight))
this.view.setBackgroundResource(view.context.color(R.color.colorBackgroundLight))
setAction(view.context.getString(R.string.common_ok)) { action.invoke() }
(this.view.layoutParams as ViewGroup.MarginLayoutParams)
.apply { setMargins(56,0,56,300) }
show()
}