GestureDetector setOnDoubleTapListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GestureDetector setOnDoubleTapListener method.

This code example shows how to use the following methods:setOnDoubleTapListener
        mContext = context;
        mController = controller;
        mRenderer = new LayerRenderer(this);
        setRenderer(mRenderer);
        setRenderMode(RENDERMODE_WHEN_DIRTY);
        mGestureDetector = new GestureDetector(context, controller.getGestureListener());
        mScaleGestureDetector =
            new SimpleScaleGestureDetector(controller.getScaleGestureListener());
        mGestureDetector.setOnDoubleTapListener(controller.getDoubleTapListener());
        mInputConnectionHandler = null;
 
        setFocusable(true);
        setFocusableInTouchMode(true);
    } 
 
    private void addToEventQueue(MotionEvent event) {
        MotionEvent copy = MotionEvent.obtain(event);
        mEventQueue.add(copy);
    } 
 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
 
	public ResidualVMEvents(Context context, ResidualVM residualvm) {
		_context = context;
		_residualvm = residualvm;
 
		_gd = new GestureDetector(context, this);
		_gd.setOnDoubleTapListener(this);
		//_gd.setIsLongpressEnabled(false); 
 
		_longPress = ViewConfiguration.getLongPressTimeout();
	} 
 
	final public void sendQuitEvent() { 
		_residualvm.pushEvent(JE_QUIT, 0, 0, 0, 0, 0, 0);
	} 
 
	public boolean onTrackballEvent(MotionEvent e) {
		_residualvm.pushEvent(JE_BALL, e.getAction(),
							(int)(e.getX() * e.getXPrecision() * 100),
							(int)(e.getY() * e.getYPrecision() * 100),
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
		mapView_ = mapView;
		isDragging_ = false;
		textBrush_ = Brush.createTextBrush(DrawingHelper.offset(context)/2);
		textBrush_.setColor(Color.BLACK);
		 
		gestureDetector_ = new GestureDetector(context, this);
		gestureDetector_.setOnDoubleTapListener(this);
		 
		undoStack_ = new ArrayList<Undoable>();
	} // SingleTapOverlay 
	 
	public void onPause(final SharedPreferences.Editor prefEditor)
	{ 
	  for(final Iterator<PauseResumeListener> overlays = pauseResumeOverlays(); overlays.hasNext(); )
	    overlays.next().onPause(prefEditor);
	} // onPause 
	 
	public void onResume(final SharedPreferences prefs)
	{ 
    for(final Iterator<PauseResumeListener> overlays = pauseResumeOverlays(); overlays.hasNext(); )
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
    public MapViewWrapper(final MapView mapView) {
        this.mapView = mapView;
        this.mapControllerWrapper = new MapControllerWrapper(mapView);
        this.overlayManager = new OverlayManager(this);
 
        final GestureDetector gd = new GestureDetector(mapView.getContext(), new SimpleOnGestureListener());
        gd.setOnDoubleTapListener(new OnDoubleTapListener() {
 
            @Override 
            public boolean onSingleTapConfirmed(MotionEvent e) {
                return false; 
            } 
 
            @Override 
            public boolean onDoubleTap(MotionEvent e) {
                mapView.getController().zoomInFixing((int) e.getX(), (int) e.getY());
                return false; 
            } 
 
            @Override 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
 
    TouchEventHandler(Context context, LayerView view, LayerController controller) {
        mView = view;
 
        mEventQueue = new LinkedList<MotionEvent>();
        mGestureDetector = new GestureDetector(context, controller.getGestureListener());
        mScaleGestureDetector = new SimpleScaleGestureDetector(controller.getScaleGestureListener());
        mPanZoomController = controller.getPanZoomController();
        mListenerTimeoutProcessor = new ListenerTimeoutProcessor();
        mDispatchEvents = true;
 
        mDoubleTapListener = controller.getDoubleTapListener();
        setDoubleTapEnabled(true); 
 
        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 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
	private GestureDetector gestureDetector;
	 
	public TornadoMapView(Context context, AttributeSet attrs) {
		super(context, attrs);
		 
		gestureDetector = new GestureDetector((OnGestureListener) context);
		gestureDetector.setOnDoubleTapListener((OnDoubleTapListener) context);
	} 
	 
	public boolean onTouchEvent(MotionEvent ev) {
		if (this.gestureDetector.onTouchEvent(ev)) {
			return true; 
		} else { 
			return super.onTouchEvent(ev);
		} 
	} 
	 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setIsLongpressEnabled, setOnDoubleTapListener
  
  public PushPinMapView(Context aContext, AttributeSet attrs) {
    super(aContext, attrs);
    context = aContext;
  
    gestureDetector = new GestureDetector((OnGestureListener) context);
    gestureDetector.setOnDoubleTapListener((OnDoubleTapListener) context);
    gestureDetector.setIsLongpressEnabled(true);
  } 
  
  // Override the onTouchEvent() method to intercept events and pass them 
  // to the GestureDetector. If the GestureDetector doesn't handle the event, 
  // propagate it up to the MapView. 
  public boolean onTouchEvent(MotionEvent ev) {
    if(this.gestureDetector.onTouchEvent(ev))
       return true; 
    else 
      return super.onTouchEvent(ev);
  } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
 * User: obrok 
 * Date: 11/4/11 
 * Time: 1:12 PM 
 */ 
public class TouchPane extends View implements GestureDetector.OnDoubleTapListener, GestureDetector.OnGestureListener {
    GestureDetector gestureDetector = new GestureDetector(this);
    @Inject EventBus eventBus;
 
    @SuppressWarnings("UnusedDeclaration") 
    public TouchPane(Context context) {
        super(context);
        initialize(context);
    } 
 
    @SuppressWarnings("UnusedDeclaration") 
    public TouchPane(Context context, AttributeSet attrs) {
        super(context, attrs);
        initialize(context);
    } 
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
        init(); 
    } 
 
    private void init() { 
        setClickable(true);
        mGestureDetector = new GestureDetector(getContext(), this);
        mGestureDetector.setOnDoubleTapListener(this);
    } 
 
    /** 
     * Set a long-press event listener to the {@link SmartMapView}. 
     *  
     * @param onLongPressListener 
     *            The long-press listener to assign. 
     */ 
    public void setOnLongPressListener(OnLongPressListener onLongPressListener) {
        mOnLongPressListener = onLongPressListener;
    } 
 
    public boolean onTouchEvent(MotionEvent ev) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnDoubleTapListener
    TouchEventHandler(Context context, View view, JavaPanZoomController panZoomController) {
        mView = view;
 
        mEventQueue = new LinkedList<MotionEvent>();
        mPanZoomController = panZoomController;
        mGestureDetector = new GestureDetector(context, mPanZoomController);
        mScaleGestureDetector = new SimpleScaleGestureDetector(mPanZoomController);
        mListenerTimeoutProcessor = new ListenerTimeoutProcessor();
        mDispatchEvents = true;
 
        mGestureDetector.setOnDoubleTapListener(mPanZoomController);
 
        Tabs.registerOnTabsChangedListener(this);
    } 
 
    public void destroy() { 
        Tabs.unregisterOnTabsChangedListener(this);
    } 
 
    /* This function MUST be called on the UI thread */ 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related GestureDetector setOnDoubleTapListener Questions & Answers:

setOnDoubleTapListener Method Overview
Sets the listener which will be called for double-tap and related gestures.
See Code Examples for other Android GestureDetector Methods: