From 3ff6be9522f17c3741498860a9188a3885bbb1e6 Mon Sep 17 00:00:00 2001 From: TobiPeterG Date: Sun, 13 Oct 2024 00:40:49 +0200 Subject: [PATCH] Only use inserts when available Fixes #9509 Signed-off-by: TobiPeterG --- .../organicmaps/widget/placepage/PlacePageController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageController.java b/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageController.java index 5e0110084b..05378c9760 100644 --- a/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageController.java +++ b/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageController.java @@ -151,6 +151,8 @@ public class PlacePageController extends Fragment implements mPlacePageStatusBarBackground.setLayoutParams(layoutParams); return windowInsets; }); + + ViewCompat.requestApplyInsets(mPlacePage); } @NonNull @@ -231,7 +233,9 @@ public class PlacePageController extends Fragment implements private void setPlacePageHeightBounds() { final int peekHeight = calculatePeekHeight(); - final Insets insets = mCurrentWindowInsets.getInsets(WindowInsetsCompat.Type.systemBars()); + final Insets insets = mCurrentWindowInsets != null + ? mCurrentWindowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) + : Insets.NONE; // Make sure the place page can reach the peek height final int minHeight = Math.max(peekHeight, mFrameHeight); // Prevent the place page from showing under the status bar