diff options
author | alexzatsepin <az@mapswithme.com> | 2016-12-07 13:18:49 +0300 |
---|---|---|
committer | alexzatsepin <az@mapswithme.com> | 2016-12-07 13:18:49 +0300 |
commit | 5024f06f8dc7841224d0650c9f6324441e511bcf (patch) | |
tree | 6e357a03d9bbbcadf1955a4e1d224400003f80ee /android | |
parent | f136bf9b916dccca5de61aa7a6290ac3f50c993d (diff) |
[android] Made myposition animation more smoother during PP closing/openning
Diffstat (limited to 'android')
-rw-r--r-- | android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java b/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java index 50d00cbbac..01dfce506e 100644 --- a/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java +++ b/android/src/com/mapswithme/maps/NavigationButtonsAnimationController.java @@ -25,7 +25,6 @@ class NavigationButtonsAnimationController private float mTopLimit; private boolean mMyPosAnimate; - private float mLastPlacePageY; NavigationButtonsAnimationController(@NonNull View zoomIn, @NonNull View zoomOut, @NonNull View myPosition) @@ -33,8 +32,6 @@ class NavigationButtonsAnimationController mZoomIn = zoomIn; mZoomOut = zoomOut; mMyPosition = myPosition; - Resources res = mZoomIn.getResources(); - mLastPlacePageY = res.getDisplayMetrics().heightPixels; calculateBottomLimit(); } @@ -80,11 +77,7 @@ class NavigationButtonsAnimationController return; float translation = translationY - mBottomLimit; - if (shouldMoveMyPosition(translationY, translation)) - animateMyPosition(translation); - else - animateMyPosition(0); - mLastPlacePageY = translationY; + animateMyPosition(translation <= 0 ? translation : 0); } private void calculateBottomLimit() @@ -227,37 +220,6 @@ class NavigationButtonsAnimationController }); } - private boolean shouldMoveMyPosition(float ppTranslationY, float translation) - { - if (ppTranslationY == mLastPlacePageY) - { - LOGGER.d("Start of movement. Nav buttons are no needed to be moved"); - return false; - } - - boolean isMoveUp = ppTranslationY < mLastPlacePageY; - if (isMoveUp) - { - if (translation > 0) - { - LOGGER.d("Move up. Bottom limit hasn't been reached yet."); - return false; - } - - LOGGER.d("Move up. PP follows the nav buttons."); - return true; - } - - if (translation <= 0) - { - LOGGER.d("Move down. Bottom limit hasn't been reached yet."); - return true; - } - - LOGGER.d("Move down. Nav buttons follow PP."); - return false; - } - private void animateMyPosition(float translation) { mMyPosition.setTranslationY(translation); |