From 854f608e6f1a9be9a15b0f040d775e65478b7358 Mon Sep 17 00:00:00 2001 From: Dmitry Strekha Date: Thu, 3 Oct 2024 15:58:01 +0300 Subject: [PATCH] [Android] Fix insets handling (#9430) [Android] Fix insets handling for the case, when the action button is hidden Signed-off-by: Dzmitry Strekha --- .../main/java/app/organicmaps/downloader/BottomPanel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/app/src/main/java/app/organicmaps/downloader/BottomPanel.java b/android/app/src/main/java/app/organicmaps/downloader/BottomPanel.java index a2916df4b9..a8ccf099b4 100644 --- a/android/app/src/main/java/app/organicmaps/downloader/BottomPanel.java +++ b/android/app/src/main/java/app/organicmaps/downloader/BottomPanel.java @@ -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();