android.view.ViewConfiguration#getScaledDoubleTapSlop ( )源码实例Demo

下面列出了android.view.ViewConfiguration#getScaledDoubleTapSlop ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: letv   文件: GestureDetectorCompat.java
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    } else if (this.mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    } else {
        this.mIsLongpressEnabled = true;
        ViewConfiguration configuration = ViewConfiguration.get(context);
        int touchSlop = configuration.getScaledTouchSlop();
        int doubleTapSlop = configuration.getScaledDoubleTapSlop();
        this.mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
        this.mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
        this.mTouchSlopSquare = touchSlop * touchSlop;
        this.mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
    }
}
 
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码3 项目: AirFree-Client   文件: GestureDetector.java
private void init(Context context, boolean ignoreMultitouch) {
    if (mListener == null) {
        throw new NullPointerException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;
    mIgnoreMultitouch = ignoreMultitouch;

    // Fallback to support pre-donuts releases
    int touchSlop, largeTouchSlop, doubleTapSlop;
    if (context == null) {
        //noinspection deprecation
        touchSlop = ViewConfiguration.getTouchSlop();
        largeTouchSlop = touchSlop + 2;
        doubleTapSlop = DOUBLE_TAP_SLOP;
    } else {
        final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        final float density = metrics.density;
        final ViewConfiguration configuration = ViewConfiguration.get(context);
        touchSlop = configuration.getScaledTouchSlop();
        largeTouchSlop = (int) (density * LARGE_TOUCH_SLOP + 0.5f);
        doubleTapSlop = configuration.getScaledDoubleTapSlop();
    }
    mTouchSlopSquare = touchSlop * touchSlop;
    mLargeTouchSlopSquare = largeTouchSlop * largeTouchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码4 项目: Slide   文件: GestureDetectorCompat.java
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码5 项目: CodenameOne   文件: GestureDetectorCompat.java
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码8 项目: V.FlyoutTest   文件: GestureDetectorCompat.java
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码9 项目: Telegram-FOSS   文件: GestureDetector2.java
private void init(Context context) {
    if (mListener == null) {
        throw new NullPointerException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    int touchSlop, doubleTapSlop, doubleTapTouchSlop;
    if (context == null) {
        touchSlop = ViewConfiguration.getTouchSlop();
        doubleTapTouchSlop = touchSlop;
        doubleTapSlop = 100;
        mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
        mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
    } else {
        final ViewConfiguration configuration = ViewConfiguration.get(context);
        touchSlop = configuration.getScaledTouchSlop();
        doubleTapTouchSlop = configuration.getScaledTouchSlop();
        doubleTapSlop = configuration.getScaledDoubleTapSlop();
        mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
        mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
    }
    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码10 项目: guideshow   文件: GestureDetectorCompat.java
private void init(Context context) {
    if (context == null) {
        throw new IllegalArgumentException("Context must not be null");
    }
    if (mListener == null) {
        throw new IllegalArgumentException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    final int touchSlop = configuration.getScaledTouchSlop();
    final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
    mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码11 项目: Telegram   文件: GestureDetector2.java
private void init(Context context) {
    if (mListener == null) {
        throw new NullPointerException("OnGestureListener must not be null");
    }
    mIsLongpressEnabled = true;

    int touchSlop, doubleTapSlop, doubleTapTouchSlop;
    if (context == null) {
        touchSlop = ViewConfiguration.getTouchSlop();
        doubleTapTouchSlop = touchSlop;
        doubleTapSlop = 100;
        mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
        mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
    } else {
        final ViewConfiguration configuration = ViewConfiguration.get(context);
        touchSlop = configuration.getScaledTouchSlop();
        doubleTapTouchSlop = configuration.getScaledTouchSlop();
        doubleTapSlop = configuration.getScaledDoubleTapSlop();
        mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
        mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
    }
    mTouchSlopSquare = touchSlop * touchSlop;
    mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
    mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
 
源代码12 项目: android-chromium   文件: GestureDetector.java
private void init(Context context) {
        if (mListener == null) {
            throw new NullPointerException("OnGestureListener must not be null");
        }
        mIsLongpressEnabled = true;

        // Fallback to support pre-donuts releases
        int touchSlop, doubleTapSlop, doubleTapTouchSlop;
/*  Commented out in Chromium for NDK compliance
        if (context == null) {
            //noinspection deprecation
            touchSlop = ViewConfiguration.getTouchSlop();
            doubleTapTouchSlop = touchSlop; // Hack rather than adding a hiden method for this
            doubleTapSlop = ViewConfiguration.getDoubleTapSlop();
            //noinspection deprecation
            mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
            mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
        } else */ {
            final ViewConfiguration configuration = ViewConfiguration.get(context);
            touchSlop = configuration.getScaledTouchSlop();
/*  Commented out in Chromium for NDK compliance and replaced with the following line.  Note that
 *  ViewConfiguration.TOUCH_SLOP has the same value as DOUBLE_TAP_TOUCH_SLOP in current Android, so
 *  this doesn't introduce a behavior difference in Android versions <= 4.2.
            doubleTapTouchSlop = configuration.getScaledDoubleTapTouchSlop();
*/
            doubleTapTouchSlop = touchSlop;
            doubleTapSlop = configuration.getScaledDoubleTapSlop();
            mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
            mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
        }
        mTouchSlopSquare = touchSlop * touchSlop;
        mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
        mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
    }
 
源代码13 项目: android-chromium   文件: GestureDetector.java
private void init(Context context) {
        if (mListener == null) {
            throw new NullPointerException("OnGestureListener must not be null");
        }
        mIsLongpressEnabled = true;

        // Fallback to support pre-donuts releases
        int touchSlop, doubleTapSlop, doubleTapTouchSlop;
/*  Commented out in Chromium for NDK compliance
        if (context == null) {
            //noinspection deprecation
            touchSlop = ViewConfiguration.getTouchSlop();
            doubleTapTouchSlop = touchSlop; // Hack rather than adding a hiden method for this
            doubleTapSlop = ViewConfiguration.getDoubleTapSlop();
            //noinspection deprecation
            mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
            mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
        } else */ {
            final ViewConfiguration configuration = ViewConfiguration.get(context);
            touchSlop = configuration.getScaledTouchSlop();
/*  Commented out in Chromium for NDK compliance and replaced with the following line.  Note that
 *  ViewConfiguration.TOUCH_SLOP has the same value as DOUBLE_TAP_TOUCH_SLOP in current Android, so
 *  this doesn't introduce a behavior difference in Android versions <= 4.2.
            doubleTapTouchSlop = configuration.getScaledDoubleTapTouchSlop();
*/
            doubleTapTouchSlop = touchSlop;
            doubleTapSlop = configuration.getScaledDoubleTapSlop();
            mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
            mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
        }
        mTouchSlopSquare = touchSlop * touchSlop;
        mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
        mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
    }