Snackbar half width on tablet

I think this is the default behavior of snackbar on tablets. check this out .

enter image description here


You can do whatever you want with your snackbar. We had the same issue with tablets and we solved like this (e.g. code below is positioning snackbar at top and gives it the full width of the parent)

View view = snackbar.getView();

// Position snackbar at top
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams)view.getLayoutParams();
params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
params.width = FrameLayout.LayoutParams.MATCH_PARENT;
view.setLayoutParams(params);