Bug 768798 - Return false from onSingleTapUp, so that the PanZoomController still gets an ACTION_UP event. r=mbrubeck
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 03 Jul 2012 10:04:10 -0400
changeset 98192 032188386b9efc55223772c1360e84e623a0bca5
parent 98191 7ae505066ea780fa7ffb4a9a8563cbc824e22314
child 98193 0ca8d61d79930b9f6326f6787a7a14908ff61205
push id23036
push userryanvm@gmail.com
push dateTue, 03 Jul 2012 23:04:46 +0000
treeherdermozilla-central@477d807660d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs768798
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 768798 - Return false from onSingleTapUp, so that the PanZoomController still gets an ACTION_UP event. r=mbrubeck
mobile/android/base/ui/PanZoomController.java
--- a/mobile/android/base/ui/PanZoomController.java
+++ b/mobile/android/base/ui/PanZoomController.java
@@ -981,36 +981,37 @@ public class PanZoomController
     @Override
     public void onLongPress(MotionEvent motionEvent) {
         sendPointToGecko("Gesture:LongPress", motionEvent);
     }
 
     @Override
     public boolean onSingleTapUp(MotionEvent motionEvent) {
         // When zooming is enabled, wait to see if there's a double-tap.
-        if (mController.getAllowZoom())
-            return false;
-        sendPointToGecko("Gesture:SingleTap", motionEvent);
-        return true;
+        if (!mController.getAllowZoom()) {
+            sendPointToGecko("Gesture:SingleTap", motionEvent);
+        }
+        // return false because we still want to get the ACTION_UP event that triggers this
+        return false;
     }
 
     @Override
     public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
         // When zooming is disabled, we handle this in onSingleTapUp.
-        if (!mController.getAllowZoom())
-            return false;
-        sendPointToGecko("Gesture:SingleTap", motionEvent);
+        if (mController.getAllowZoom()) {
+            sendPointToGecko("Gesture:SingleTap", motionEvent);
+        }
         return true;
     }
 
     @Override
     public boolean onDoubleTap(MotionEvent motionEvent) {
-        if (!mController.getAllowZoom())
-            return false;
-        sendPointToGecko("Gesture:DoubleTap", motionEvent);
+        if (mController.getAllowZoom()) {
+            sendPointToGecko("Gesture:DoubleTap", motionEvent);
+        }
         return true;
     }
 
     private void cancelTouch() {
         GeckoEvent e = GeckoEvent.createBroadcastEvent("Gesture:CancelTouch", "");
         GeckoAppShell.sendEventToGecko(e);
     }