6package org.mozilla.gecko.gfx;
8import android.content.Context;
9import android.os.SystemClock;
10import android.util.Log;
11import android.view.GestureDetector;
12import android.view.MotionEvent;
13import android.view.View;
15import java.util.LinkedList;
16import java.util.Queue;
120 TouchEventHandler(Context context, View view, JavaPanZoomController panZoomController) {
209 int action = (
event.getAction() & MotionEvent.ACTION_MASK);
210 return (
action == MotionEvent.ACTION_DOWN ||
action == MotionEvent.ACTION_POINTER_DOWN);
214 int action = (
event.getAction() & MotionEvent.ACTION_MASK);
215 return (
action == MotionEvent.ACTION_UP ||
action == MotionEvent.ACTION_CANCEL);
237 if (!allowDefaultAction) {
240 long now = SystemClock.uptimeMillis();
262 if (allowDefaultAction) {
A less buggy, and smoother, replacement for the built-in Android ScaleGestureDetector.
boolean isInProgress()
Returns true if the scale gesture is in progress and false otherwise.
void onTouchEvent(MotionEvent event)
Forward touch events to this function.
This class handles incoming touch events from the user and sends them to listeners in Gecko and/or pe...
final SimpleScaleGestureDetector mScaleGestureDetector
void dispatchEvent(MotionEvent event)
Dispatch the event to the gesture detectors and the pan/zoom controller.
final int EVENT_LISTENER_TIMEOUT
void processEventBlock(boolean allowDefaultAction)
Process the block of events at the head of the queue now that we know whether it has been default-pre...
final JavaPanZoomController mPanZoomController
boolean touchFinished(MotionEvent event)
static final String LOGTAG
final GestureDetector mGestureDetector
void setWaitForTouchListeners(boolean aValue)
boolean mWaitForTouchListeners
void handleEventListenerAction(boolean allowDefaultAction)
This function is how gecko sends us a default-prevented notification.
final ListenerTimeoutProcessor mListenerTimeoutProcessor
boolean handleEvent(MotionEvent event)
boolean isDownEvent(MotionEvent event)
final Queue< MotionEvent > mEventQueue