[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:
Dmitry Strekha 2024-10-03 15:58:01 +03:00 committed by GitHub
parent 7566dc400f
commit 854f608e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();