forked from organicmaps/organicmaps
[android] Added setting peek height ignored if banner being opened to avoid jump when pp collapsed after expanding
This commit is contained in:
parent
ff66154204
commit
e434df10f7
1 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue