Android resizes the text of description automatically but it can not resize the text of ActionButton, so, if the text of button increases, Android will make that type of layout itself.
Here is the simple example ->
Snackbar snackbar = Snackbar
.make(mainLayout, "Confirm delete?", Snackbar.LENGTH_LONG)
.setAction("YES", new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar mSnackbar = Snackbar.make(mainLayout, "Message successfully deleted.", Snackbar.LENGTH_SHORT);
mSnackbar.show();
}
});
snackbar.show();