diff --git a/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java b/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java index 7e309dbab1..f6a9575576 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java @@ -58,6 +58,12 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca private int mCurrentTop; private boolean mPeekHeightAnimating; private int mOpenBannerTouchSlop; + /** + * Represents a value that describes what the part of the banner is opened for details. + * Must be in the range [0;1]. 0 means that the banner details is completely closed, + * 1 - the details completely opened. + */ + private float mBannerRatio; @SuppressWarnings("NullableProblems") @NonNull private BannerController mBannerController; @@ -114,6 +120,7 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca int maxDistance = Math.abs(bannerMaxY - bannerMinY); int yDistance = Math.abs(mCurrentTop - bannerMinY); float ratio = (float) yDistance / maxDistance; + mBannerRatio = ratio; if (ratio >= 1) { @@ -238,6 +245,12 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca return; } + if (mBannerRatio > 0) + { + Log.d(TAG, "Banner is being opened, ignore."); + return; + } + final int peekHeight = getPeekHeight(); if (peekHeight == mPlacePageBehavior.getPeekHeight()) return;