Android GestureDetector.OnGestureListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android GestureDetector.OnGestureListener class.

This code example shows how to use the following methods:onShowPress
	} 
 
	@Override 
	public void onShowPress(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onShowPress(e);
		} 
	} 
 
	@Override 
	public boolean onSingleTapUp(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onSingleTapUp(e);
		} 
		return false; 
	} 
 
	public boolean isLongpressEnabled() { 
		return gestureDetector.isLongpressEnabled();
	} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onDown
 	 * @see android.view.GestureDetector.OnGestureListener#onDown(android.view.MotionEvent) 
 	 */ 
 	@Override 
	 public boolean onDown(MotionEvent e) {
	  if (onGestureListener != null) {
	   return onGestureListener.onDown(e);
	  } 
	  return false; 
	 } 
 
	 /* (non-Javadoc) 
 	 * @see android.view.GestureDetector.OnGestureListener#onFling(android.view.MotionEvent, android.view.MotionEvent, float, float) 
 	 */ 
 	@Override 
	 public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
	   float velocityY) {
	  if (onGestureListener != null) {
	   return onGestureListener.onFling(e1, e2, velocityX, velocityY);
	  } 
	  return false; 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onFling
 
    @Override 
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
    { 
        if ( listener != null ) {
            return listener.onFling(e1, e2, velocityX, velocityY);
             
        } 
         
        return false; 
    } 
 
    @Override 
    public void onLongPress(MotionEvent e)
    { 
        if ( listener != null ) {
            listener.onLongPress(e);
             
        } 
         
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onFling
 
	 @Override 
	 public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
	   float velocityY) {
	  if (onGestureListener != null) {
	   return onGestureListener.onFling(e1, e2, velocityX, velocityY);
	  } 
	  return false; 
	 } 
 
	 @Override 
	 public void onLongPress(MotionEvent e) {
	  if (onGestureListener != null) {
	   onGestureListener.onLongPress(e);
	  } 
	 } 
 
	 @Override 
	 public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
	   float distanceY) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onShowPress
	} 
 
	@Override 
	public void onShowPress(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onShowPress(e);
		} 
	} 
 
	@Override 
	public boolean onSingleTapUp(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onSingleTapUp(e);
		} 
		return false; 
	} 
 
	public boolean isLongpressEnabled() { 
		return gestureDetector.isLongpressEnabled();
	} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onSingleTapUp
    // Click事件 
    @Override 
    public boolean onSingleTapUp(MotionEvent e) {
        if (null != mOnGestureListener) {
            GLogger.v("Test", "On single tap"); 
            mOnGestureListener.onSingleTapUp(e);
        } 
        return false; 
    } 
 
    /** 
     * @Description 根据图像大小设置预览尺寸. 
     * @author zengchuanmeng 
     * @param 
     * @return void 
     */ 
//    private void calculatePicPreviewSize(int orgWidth, int orgHeight, int screenW, int screenH) { 
//        // LogUtil.logMethodName(); 
//        int effPreWidth, effPreHeight, effPreTop, effPreLeft; 
// 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onScroll
	} 
 
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		if (onGestureListener != null) {
			onGestureListener.onScroll(e1, e2, distanceX, distanceY);
		} 
		return false; 
	} 
 
	public void onShowPress(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onShowPress(e);
		} 
	} 
 
	public boolean onSingleTapUp(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onSingleTapUp(e);
		} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onDown
	} 
 
	@Override 
	public boolean onDown(MotionEvent e) {
		if (onGestureListener != null) {
			return onGestureListener.onDown(e);
		} 
		return false; 
	} 
 
	@Override 
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {
		if (onGestureListener != null) {
			return onGestureListener.onFling(e1, e2, velocityX, velocityY);
		} 
		return false; 
	} 
 
	@Override 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onLongPress
        return mInLongPress;
    } 
 
    private void dispatchLongPress() { 
        mInLongPress = true;
        mListener.onLongPress(mCurrentDownEvent);
    } 
 
    protected boolean hasPendingMessage() { 
        return mHandler.hasMessages(LONG_PRESS);
    } 
 
    void onOfferTouchEventToNative(MotionEvent event) {
        if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
            mMoveConfirmed = false;
            mTouchInitialX = Math.round(event.getX());
            mTouchInitialY = Math.round(event.getY());
        } 
    } 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:onShowPress
		return false; 
	} 
 
	public void onShowPress(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onShowPress(e);
		} 
	} 
 
	public boolean onSingleTapUp(MotionEvent e) {
		if (onGestureListener != null) {
			onGestureListener.onSingleTapUp(e);
		} 
		return false; 
	} 
 
	public boolean isLongpressEnabled() { 
		return gestureDetector.isLongpressEnabled();
	} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android GestureDetector.OnGestureListener Questions & Answers:

See Code Examples for Android GestureDetector.OnGestureListener Methods: