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
None of the above solutions worked for me. This is my solution, my idea is create the background with transparent side, so looks like a margin. Try this works for me:
Create drawable for background
-
-
Using kotlin extension to show Snackbar and add the padding
private fun Snackbar.show(context: Context) {
this.view.setPadding(Dpx.dpToPx(16), Dpx.dpToPx(16), Dpx.dpToPx(16), Dpx.dpToPx(16))
this.view.background = context.getDrawable(R.drawable.bg_snackbar)
show()
}
Call Snackbar make
Snackbar.make(view, R.string.my_message, Snackbar.LENGTH_SHORT).show(this)
Thats all. Tell me if that works, thanks...