From 1e7a8dc9a159225752a55807a67a6d8e49798de8 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Thu, 16 Oct 2014 15:52:22 +0300 Subject: [PATCH] Close PPP with swipe to the top. --- .../mapswithme/maps/widget/MapInfoView.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/android/src/com/mapswithme/maps/widget/MapInfoView.java b/android/src/com/mapswithme/maps/widget/MapInfoView.java index d0dddf0764..e8453dbe38 100644 --- a/android/src/com/mapswithme/maps/widget/MapInfoView.java +++ b/android/src/com/mapswithme/maps/widget/MapInfoView.java @@ -89,6 +89,7 @@ public class MapInfoView extends LinearLayout implements View.OnClickListener private ImageView mColorImage; // Gestures private GestureDetectorCompat mGestureDetector; + private boolean mIsGestureHandled; private float mDownY; private float mTouchSlop; // Data @@ -209,13 +210,24 @@ public class MapInfoView extends LinearLayout implements View.OnClickListener if (isVertical && isInRange) { - if (distanceY > 0) - setState(State.PREVIEW_ONLY); - else - setState(State.FULL_PLACEPAGE); + if (!mIsGestureHandled) + { + if (distanceY > 0) + { + if (mCurrentState == State.FULL_PLACEPAGE) + setState(State.PREVIEW_ONLY); + else + setState(State.HIDDEN); + } + else + setState(State.FULL_PLACEPAGE); + + mIsGestureHandled = true; + } return true; } + return false; } @@ -248,6 +260,7 @@ public class MapInfoView extends LinearLayout implements View.OnClickListener case MotionEvent.ACTION_CANCEL: break; case MotionEvent.ACTION_DOWN: + mIsGestureHandled = false; mDownY = event.getRawY(); break; case MotionEvent.ACTION_MOVE: