Code example for GestureDetector

Methods: setOnDoubleTapListener

0
    TouchEventHandler(Context context, LayerView view, LayerController controller) {
        mView = view;
        mController = controller;
 
        mEventQueue = new LinkedList<MotionEvent>();
        mGestureDetector = new GestureDetector(context, controller.getGestureListener());
        mScaleGestureDetector = new SimpleScaleGestureDetector(controller.getScaleGestureListener());
        mListenerTimeoutProcessor = new ListenerTimeoutProcessor();
        mDispatchEvents = true;
 
        mGestureDetector.setOnDoubleTapListener(controller.getDoubleTapListener());
        Tabs.registerOnTabsChangedListener(this);
    } 
 
    /* This function MUST be called on the UI thread */ 
    public boolean handleEvent(MotionEvent event) {
        // if we don't have gecko listeners, just dispatch the event 
        // and be done with it, no extra work needed. 
        if (mOnTouchListener == null) {
            dispatchEvent(event);
            return true;