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