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
The key to controlling the Snackbar display is using a android.support.design.widget.CoordinatorLayout
Layout. Without it your Snackbar will always be displayed filled at the bottom on small devices and at the bottom left of large devices. Note: You may use the CoordinatorLayout
as the root ViewGroup
of your layout or anywhere in your layout tree structure.
After adding it, ensure you are passing the CoordinatorLayout
(or child) as the first argument of the Snackbar.make() command.
By adding padding or margins to your CoordinatorLayout
you can control the position and move the Snackbar from the bottom of the screen.
The material design guidelines specify a minimum and maximum width of the Snackbar. On small devices you will see it fill the width of the screen, while on tablets you will see the Snackbar hit the maximum width and not fill the width of the screen.