forked from organicmaps/organicmaps
[Android] Fix insets handling (#9430)
[Android] Fix insets handling for the case, when the action button is hidden Signed-off-by: Dzmitry Strekha <mr.choo96@gmail.com>
This commit is contained in:
parent
7566dc400f
commit
854f608e6f
1 changed files with 6 additions and 0 deletions
|
@ -75,10 +75,16 @@ class BottomPanel
|
|||
ViewGroup.MarginLayoutParams fabParams = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
|
||||
ViewGroup.MarginLayoutParams buttonParams = (ViewGroup.MarginLayoutParams) mButton.getLayoutParams();
|
||||
|
||||
final boolean isButtonVisible = UiUtils.isVisible(mButton);
|
||||
|
||||
buttonParams.bottomMargin = safeInsets.bottom;
|
||||
mButton.setPadding(safeInsets.left, mButton.getPaddingTop(), safeInsets.right, mButton.getPaddingBottom());
|
||||
|
||||
fabParams.rightMargin = safeInsets.right + baseMargin;
|
||||
if (isButtonVisible)
|
||||
fabParams.bottomMargin = baseMargin;
|
||||
else
|
||||
fabParams.bottomMargin = safeInsets.bottom + baseMargin;
|
||||
|
||||
mFab.requestLayout();
|
||||
mButton.requestLayout();
|
||||
|
|
Loading…
Add table
Reference in a new issue