Regardless of whether or not it is a good idea to create a custom Snackbar, I have a custom Snackbar and I can\'t seem to get rid of the margins. I\'ve tried several things
In dimens.xml.
Use this:
<dimen name="design_snackbar_padding_horizontal">0dp</dimen>
But remember that this will get applied to all the snackbars in your application.
Add to theme of App or Activity <item name="snackbarStyle">@style/Widget.Design.Snackbar</item>
Before showing the Snackbar you can remove the parent layout padding in the following way:
//...
_firmwareSnackbar.getView().setPadding(0,0,0,0);
_firmwareSnackbar.show();
You shoud remove paddings from a parent view:
View snackBarLayout = findViewById(R.id.mainLayout);
Snackbar globalSnackbar = Snackbar.make(snackBarLayout, "", Snackbar.LENGTH_INDEFINITE);
Snackbar.SnackbarLayout layout = (Snackbar.SnackbarLayout) globalSnackbar.getView();
layout.setPadding(0,0,0,0);