Android View.OnLongClickListener - 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 View.OnLongClickListener class.

This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
                        // forward long click listener 
                        @Override 
                        public void onLongPress(MotionEvent e) {
                            if(null != mLongClickListener) {
                                mLongClickListener.onLongClick(mImageView.get());
                            } 
                        }}); 
 
            mGestureDetector.setOnDoubleTapListener(this);
 
            // Finally, update the UI so that we're zoomable 
            setZoomable(true); 
        } 
    } 
 
    @Override 
    public final boolean canZoom() { 
        return mZoomEnabled;
    } 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
    private final Runnable repeatAction = new Runnable() {
        @Override 
        public void run() { 
            if (repeatClickListener != null) { 
                boolean res = repeatClickListener 
                    .onLongClick(RepeatImageButton.this); 
                if (res == true) 
                    mHandler.postDelayed(this, interval); 
                longClickFired = true; 
            } 
        } 
    }; 
 
    public RepeatImageButton(Context ctx, AttributeSet attrs) {
        super(ctx, attrs);
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
4
CodeRank
This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank
This code example shows how to use the following methods:onLongClick
			this.isClickEnabled = false;
			if (getView().isLongClickable() 
					&& !TouchManager.this.scaleGestureDetector.isInProgress()
					&& !TouchManager.this.moveGestureDetector.isInProgress()) {
				if (this.onLongClickListener!=null) {
					b = this.onLongClickListener.onLongClick(v);
				} 
				if (!b) {
					PointerEventAndroid e = TouchManager.this.moveGestureDetector.lastPointerEvent;
					if (e!=null) {
						e.unconsume();
						e.setWhen(System.currentTimeMillis());
						getView().onLongClick(e);
						b = e.isConsumed();
					} 
				} 
			} 
			return b;
		} 
 
3
CodeRank
This code example shows how to use the following methods:onLongClick
 
						// forward long click listener 
						@Override 
						public void onLongPress(MotionEvent e) {
							if(null != mLongClickListener) {
								mLongClickListener.onLongClick(mImageView.get());
							} 
						}}); 
 
			mGestureDetector.setOnDoubleTapListener(this);
 
			// Finally, update the UI so that we're zoomable 
			setZoomable(true); 
		} 
	} 
 
	@Override 
	public final boolean canZoom() { 
		return mZoomEnabled;
	} 
3
CodeRank

Related Android View.OnLongClickListener Questions & Answers:

Other Android View.OnLongClickListener Examples

16:	    // define the contextual action mode
17:	    View view = findViewById(R.id.myView);
18:	    view.setOnLongClickListener(new View.OnLongClickListener() {
19:	      // called when the user long-clicks on someView
20:	      public boolean onLongClick(View view) {

Read More

See Code Examples for Android View.OnLongClickListener Methods: