I am currently implementing the MaterialComponents Snackbar in my app and as I started using
(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
the Snackbar started drawing behind the navigation bar. Usually this shouldn't be of a problem as I would just use code to define a margin on the Snackbar including the navigation bar height, but whyever, it does not get applied and stays like so:
The code I used to define the margin is as follows:
final ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) snackBarView.getLayoutParams();
params.setMargins(params.leftMargin, params.topMargin, params.rightMargin, params.bottomMargin + ThemeUtils.getNavigationBarHeight(this));
snackBarView.setLayoutParams(params);
Does anybody see an error I am making? Any help on fixing this would be massively appreciated! Thanks in advance!