[android] Fixed touch on 'Leave review' button in PPP

Made it so that PP is not moved durtin 'Leave a review' touch
This commit is contained in:
Александр Зацепин 2017-10-05 17:55:03 +03:00 committed by Arsentiy Milchakov
parent 340ec57f8a
commit fa55fcec30
3 changed files with 13 additions and 1 deletions

View file

@ -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)
{

View file

@ -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;

View file

@ -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()
{