I have a class:
public final class MySnackbar<T>
extends BaseTransientBottomBar<AccountSnackbar<T>>
I try to add margins to MySnackbar
by calling in the ctor to:
private void setSnackbarContainerMargins(Context context, View content) {
MarginLayoutParams layoutParams = (MarginLayoutParams) getView().getLayoutParams();
int horizontalMargin =
layoutParams.leftMargin = horizontalMargin;
layoutParams.rightMargin = horizontalMargin;
layoutParams.bottomMargin =
parent.setLayoutParams(layoutParams);
}
At runtime, I see the margins stay the same.
Is there any other way to add extra margins to the my custom snackbar?