From fa55fcec307ff761eb85a2079bdaad4d14cab3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Thu, 5 Oct 2017 17:55:03 +0300 Subject: [PATCH] [android] Fixed touch on 'Leave review' button in PPP Made it so that PP is not moved durtin 'Leave a review' touch --- android/src/com/mapswithme/maps/ugc/UGCController.java | 6 ++++++ .../placepage/BottomPlacePageAnimationController.java | 3 ++- .../com/mapswithme/maps/widget/placepage/PlacePageView.java | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/android/src/com/mapswithme/maps/ugc/UGCController.java b/android/src/com/mapswithme/maps/ugc/UGCController.java index 95e51aadd2..5a2cfcce0a 100644 --- a/android/src/com/mapswithme/maps/ugc/UGCController.java +++ b/android/src/com/mapswithme/maps/ugc/UGCController.java @@ -6,6 +6,7 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.view.MotionEvent; import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -160,6 +161,11 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener UiUtils.hide(mUgcRootView, mLeaveReviewButton); } + public boolean isLeaveReviewButtonTouched(@NonNull MotionEvent event) + { + return UiUtils.isViewTouched(event, mLeaveReviewButton); + } + @Override public void onUGCReceived(@NonNull UGC ugc) { diff --git a/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java index ab1f45a0a2..5e1ae4d294 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java @@ -111,7 +111,8 @@ class BottomPlacePageAnimationController extends BasePlacePageAnimationControlle case MotionEvent.ACTION_UP: final boolean isInside = UiUtils.isViewTouched(event, mDetailsScroll); final boolean isBannerTouch = mPlacePage.isBannerTouched(event); - if (isInside && !isBannerTouch && mIsGestureStartedInsideView) + boolean isLeaveReviewButtonTouched = mPlacePage.isLeaveReviewButtonTouched(event); + if (isInside && !isBannerTouch && !isLeaveReviewButtonTouched && mIsGestureStartedInsideView) mGestureDetector.onTouchEvent(event); mIsDragging = false; break; diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 56a4e877f1..528181ac12 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -2203,6 +2203,11 @@ public class PlacePageView extends RelativeLayout return mBannerController != null && mBannerController.isActionButtonTouched(event); } + public boolean isLeaveReviewButtonTouched(@NonNull MotionEvent event) + { + return mUgcController != null && mUgcController.isLeaveReviewButtonTouched(event); + } + @Override public void onSizeChanged() {