forked from organicmaps/organicmaps
[android] Separated anim duration for regular peek height changind during layout phase from the banner appearing to avoid long period of unscrollable state for pp
This commit is contained in:
parent
562281905e
commit
9476f6da1b
2 changed files with 9 additions and 2 deletions
|
@ -411,6 +411,11 @@ final class BannerController
|
|||
return mCurrentAd != null;
|
||||
}
|
||||
|
||||
int getClosedHeight()
|
||||
{
|
||||
return mClosedHeight;
|
||||
}
|
||||
|
||||
private void setBannerState()
|
||||
{
|
||||
if (mCurrentAd == null)
|
||||
|
|
|
@ -40,7 +40,8 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca
|
|||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = BottomSheetPlacePageController.class.getSimpleName();
|
||||
private static final String EXTRA_MAP_OBJECT = "extra_map_object";
|
||||
private static final int PEEK_HEIGHT_ANIM_DURATION = 300;
|
||||
private static final int ANIM_BANNER_APPEARING_MS = 300;
|
||||
private static final int ANIM_CHANGE_PEEK_HEIGHT_MS = 100;
|
||||
@NonNull
|
||||
private final Activity mActivity;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
|
@ -296,7 +297,8 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca
|
|||
{
|
||||
int delta = peekHeight - mPlacePageBehavior.getPeekHeight();
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(mPlacePage, "translationY", -delta);
|
||||
animator.setDuration(PEEK_HEIGHT_ANIM_DURATION);
|
||||
animator.setDuration(delta == mBannerController.getClosedHeight() ? ANIM_BANNER_APPEARING_MS
|
||||
: ANIM_CHANGE_PEEK_HEIGHT_MS);
|
||||
animator.addListener(new UiUtils.SimpleAnimatorListener()
|
||||
{
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue