Java Code Examples for android.support.v4.view.GestureDetectorCompat#setOnDoubleTapListener()

The following examples show how to use android.support.v4.view.GestureDetectorCompat#setOnDoubleTapListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Attacher.java    From PicKing with Apache License 2.0 6 votes vote down vote up
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
 
Example 2
Source File: Attacher.java    From CanPhotos with Apache License 2.0 6 votes vote down vote up
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
 
Example 3
Source File: Attacher.java    From SprintNBA with Apache License 2.0 6 votes vote down vote up
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
 
Example 4
Source File: Attacher.java    From TLint with Apache License 2.0 6 votes vote down vote up
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override
                public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
 
Example 5
Source File: ScalableView.java    From Android_UE with Apache License 2.0 5 votes vote down vote up
private void init() {
    // 图片的大小
    mImageSize = Utils.dp2px(300);
    // 获取图片
    mBitmap = Utils.getDrawableBitmap(getContext(), R.drawable.icon_android_road, mImageSize);
    // 画笔
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

    //
    gestureDetectorCompat = new GestureDetectorCompat(getContext(), this);
    gestureDetectorCompat.setOnDoubleTapListener(this);
    scroller = new OverScroller(getContext());
    scaleGestureDetector = new ScaleGestureDetector(getContext(), new ScaleImageScaleGestureDetector());
}
 
Example 6
Source File: BaseGridScaler.java    From MultiView with Apache License 2.0 5 votes vote down vote up
private void init() {
    gestureDetector = new GestureDetectorCompat(context, this);
    gestureDetector.setOnDoubleTapListener(this);
    scaleGestureDetector = new ScaleGestureDetector(context, this);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        scaleGestureDetector.setQuickScaleEnabled(false);
    }
}
 
Example 7
Source File: ScalableRecyclerGridView.java    From MultiView with Apache License 2.0 5 votes vote down vote up
private void init() {
    gestureDetector = new GestureDetectorCompat(context, this);
    gestureDetector.setOnDoubleTapListener(this);
    scaleGestureDetector = new ScaleGestureDetector(context, this);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        scaleGestureDetector.setQuickScaleEnabled(false);
    }
}
 
Example 8
Source File: TouchGestureDetector.java    From ByakuGallery with Apache License 2.0 4 votes vote down vote up
public TouchGestureDetector(Context context, OnTouchGestureListener listener) {
	mGestureDetector = new GestureDetectorCompat(context, listener);
	mGestureDetector.setOnDoubleTapListener(listener);
	mScaleGestureDetector = new ScaleGestureDetector(context, listener);
	ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, false);
}