GestureDetector onTouchEvent - 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 onTouchEvent method.

This code example shows how to use the following methods:onTouchEvent
		boolean handled = false;
		if (enableZoomControls) {
			if (zoomControls.getVisibility() == View.VISIBLE) {
				zoomControls.onTouchEvent(ev);
			} 
			handled = gestureDetector.onTouchEvent(ev);
		} 
		if (!handled) {
			handled = super.onTouchEvent(ev);
		} 
		return handled;
	} 
 
	@Override 
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
	{ 
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
 
		int maxWidth = 0;
		int maxHeight = 0;
9
CodeRank
This code example shows how to use the following methods:onTouchEvent
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        if (this.gestureDetector != null)
            this.gestureDetector.onTouchEvent(ev);
        return super.onTouchEvent(ev);
    } 
 
    @Override 
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (this.gestureDetector != null && ev.getActionMasked() == MotionEvent.ACTION_DOWN)
            this.gestureDetector.onTouchEvent(ev);
        return super.dispatchTouchEvent(ev);
 
    } 
} 
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        try { 
            gestureDetector.onTouchEvent(ev);
            return super.onTouchEvent(ev);
        } catch (Exception e) {
            Log.e("GoogleMapView.onTouchEvent", e);
        } 
        return false; 
    } 
 
    private class GestureListener extends SimpleOnGestureListener {
        @Override 
        public boolean onDoubleTap(MotionEvent e) {
            getController().zoomInFixing((int) e.getX(), (int) e.getY());
            if (onDragListener != null) {
                onDragListener.onDrag();
            } 
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
		// event.getAction() codes. 
 
		// Note that we are now calling the gesture Detectors onTouchEvent. 
		// And given we've set this class as the GestureDetectors listener 
		// the onFling, onSingleTap etc methods will be executed. 
		return gDetector.onTouchEvent(event);
	} 
 
	public GestureDetector getDetector() {
		return gDetector;
	} 
} 
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
		return true; 
	} 
 
	@Override 
	public final boolean onTouch(final View v, final MotionEvent event) {
		mGestureDector.onTouchEvent(event);
		return false; 
	} 
 
	public void setPullToRefreshEnabled(final boolean enabled) {
		if (mPullToRefreshAttacherActivity == null) return;
		mPullToRefreshAttacherActivity.setPullToRefreshEnabled(this, enabled);
	} 
 
	public void setRefreshComplete() { 
		if (mPullToRefreshAttacherActivity == null) return;
		mPulledUp = false;
		mPullToRefreshAttacherActivity.setRefreshComplete(this);
	} 
 
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
			return getWidth();
		} 
	} 
	@Override 
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (mGestureDetector.onTouchEvent(ev)) {
            return true; 
        } 
        if(!mInterceptClicks){
	        return super.onInterceptTouchEvent(ev);
        } 
        return true; 
    }	 
	@Override 
    public boolean onTouchEvent(MotionEvent ev) {
        if (mGestureDetector.onTouchEvent(ev)) {
            return true; 
        } 
        if(!mInterceptClicks){
	        return super.onTouchEvent(ev);
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
 
	}; 
	 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		boolean retval = mScrollGestureDetector.onTouchEvent(event);
		 
		if(event.getAction() == MotionEvent.ACTION_UP){
			mIsFingerDown = false;
			if(getChildCount() > 0){
				int topOfFirstChild = getChildAt(0).getTop();
				if(topOfFirstChild + mdY > 0){
					mScroller.forceFinished(true);
					mLastY = 0;
					mScroller.startScroll(0, 0, mdY, -mYOffset);
					requestLayout();
				} 
			} 
		} 
		 
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
This code example shows how to use the following methods:onTouchEvent
        updateCurrentView(); 
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent event) {
        mGestureDetector.onTouchEvent(event);
        return true; 
    } 
 
    @Override 
    public boolean onInterceptTouchEvent(MotionEvent event) {
        return mGestureDetector.onTouchEvent(event);
    } 
 
    void moveLeft() { 
        //  <-- 
        if (mCurrentView < mChildren.length - 1 && mPreviousMove != LEFT) {
            mChildren[mCurrentView+1].setVisibility(View.VISIBLE);
            mChildren[mCurrentView+1].startAnimation(inLeft);
            mChildren[mCurrentView].startAnimation(outLeft);
8
CodeRank
This code example shows how to use the following methods:onTouchEvent
        } 
        return processEvent(event);
    } 
 
    private boolean processEvent(MotionEvent event) {
        if (mGestureDetector.onTouchEvent(event))
            return true; 
        mScaleGestureDetector.onTouchEvent(event);
        if (mScaleGestureDetector.isInProgress())
            return true; 
        mController.getPanZoomController().onTouchEvent(event);
        return true; 
    } 
 
    public LayerController getController() { return mController; }
 
    /** The LayerRenderer calls this to indicate that the window has changed size. */ 
    public void setViewportSize(IntSize size) {
        mController.setViewportSize(new FloatSize(size));
    } 
8
CodeRank

Related GestureDetector onTouchEvent Questions & Answers:

onTouchEvent Method Overview
Analyzes the given motion event and if applicable triggers the appropriate callbacks on the GestureDetector.OnGestureListener supplied.
See Code Examples for other Android GestureDetector Methods: