From 4b0ec67ffd250a63ece8bc6a16958ed76c413a31 Mon Sep 17 00:00:00 2001 From: "a.marchuk" Date: Tue, 4 Aug 2015 12:10:24 +0300 Subject: [PATCH] [android] del: Unnecessary check removed. --- .../BasePlacePageAnimationController.java | 2 +- .../PlacePageBottomAnimationController.java | 24 +++++++++---------- .../PlacePageLeftAnimationController.java | 8 +++---- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/android/src/com/mapswithme/maps/widget/placepage/BasePlacePageAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/BasePlacePageAnimationController.java index 8e620f13ed..c402c8741e 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BasePlacePageAnimationController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BasePlacePageAnimationController.java @@ -94,7 +94,7 @@ public abstract class BasePlacePageAnimationController return mGestureDetector.onTouchEvent(event); } - protected void finishAnimation(boolean previewShown, boolean ppShown) + protected void notifyVisibilityListener(boolean previewShown, boolean ppShown) { if (mVisibilityChangedListener != null) { diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageBottomAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageBottomAnimationController.java index bd3e7b0a8f..d872ae9053 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageBottomAnimationController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageBottomAnimationController.java @@ -193,12 +193,11 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle } UiUtils.invisible(mFrame); - finishAnimation(true, false); + notifyVisibilityListener(true, false); return; } - if (mAnimationHelper != null) - mFrame.addOnLayoutChangeListener(mAnimationHelper.mListener); + mFrame.addOnLayoutChangeListener(mAnimationHelper.mListener); ValueAnimator animator; Interpolator interpolator; @@ -226,7 +225,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle @Override public void onAnimationEnd(Animator animation) { - finishAnimation(true, false); + notifyVisibilityListener(true, false); } }); } @@ -250,7 +249,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle public void onAnimationEnd(Animator animation) { UiUtils.invisible(mFrame, mBookmarkDetails); - finishAnimation(true, false); + notifyVisibilityListener(true, false); } }); } @@ -285,7 +284,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle if (NO_ANIMATION) { refreshToolbarVisibility(); - finishAnimation(true, true); + notifyVisibilityListener(true, true); mDetails.scrollTo(0, 0); UiUtils.hide(mBookmarkDetails); return; @@ -313,7 +312,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle public void onAnimationEnd(Animator animation) { refreshToolbarVisibility(); - finishAnimation(true, true); + notifyVisibilityListener(true, true); mDetails.scrollTo(0, 0); UiUtils.invisible(mBookmarkDetails); } @@ -332,7 +331,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle if (NO_ANIMATION) { refreshToolbarVisibility(); - finishAnimation(true, true); + notifyVisibilityListener(true, true); return; } @@ -357,7 +356,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle public void onAnimationEnd(Animator animation) { refreshToolbarVisibility(); - finishAnimation(true, true); + notifyVisibilityListener(true, true); } }); @@ -389,12 +388,11 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle if (NO_ANIMATION) { UiUtils.hide(mPlacePage); - finishAnimation(false, false); + notifyVisibilityListener(false, false); return; } - if (mAnimationHelper != null) - mFrame.removeOnLayoutChangeListener(mAnimationHelper.mListener); + mFrame.removeOnLayoutChangeListener(mAnimationHelper.mListener); final float animHeight = mPlacePage.getHeight() - mPreview.getTop() - ViewHelper.getTranslationY(mPreview); final ValueAnimator animator = ValueAnimator.ofFloat(0f, animHeight); @@ -413,7 +411,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle { UiUtils.invisible(mPlacePage, mBookmarkDetails); ViewHelper.setTranslationY(mPlacePage, 0); - finishAnimation(false, false); + notifyVisibilityListener(false, false); } }); animator.setDuration(DURATION); diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageLeftAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageLeftAnimationController.java index 50cb3de856..5efef115e9 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageLeftAnimationController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageLeftAnimationController.java @@ -117,7 +117,7 @@ class PlacePageLeftAnimationController extends BasePlacePageAnimationController if (NO_ANIMATION) { - finishAnimation(true, true); + notifyVisibilityListener(true, true); return; } @@ -135,7 +135,7 @@ class PlacePageLeftAnimationController extends BasePlacePageAnimationController @Override public void onAnimationEnd(Animator animation) { - finishAnimation(true, true); + notifyVisibilityListener(true, true); } }); @@ -149,7 +149,7 @@ class PlacePageLeftAnimationController extends BasePlacePageAnimationController if (NO_ANIMATION) { UiUtils.hide(mPlacePage); - finishAnimation(false, false); + notifyVisibilityListener(false, false); return; } @@ -169,7 +169,7 @@ class PlacePageLeftAnimationController extends BasePlacePageAnimationController public void onAnimationEnd(Animator animation) { UiUtils.invisible(mPlacePage); - finishAnimation(false, false); + notifyVisibilityListener(false, false); } });