RecyclerView.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:PlusGram 作者:
/**
 * Configure the scrolling touch slop for a specific use case.
 *
 * Set up the RecyclerView's scrolling motion threshold based on common usages.
 * Valid arguments are {@link #TOUCH_SLOP_DEFAULT} and {@link #TOUCH_SLOP_PAGING}.
 *
 * @param slopConstant One of the <code>TOUCH_SLOP_</code> constants representing
 *                     the intended usage of this RecyclerView
 */
public void setScrollingTouchSlop(int slopConstant) {
    final ViewConfiguration vc = ViewConfiguration.get(getContext());
    switch (slopConstant) {
        default:
            Log.w(TAG, "setScrollingTouchSlop(): bad argument constant "
                    + slopConstant + "; using default value");
            // fall-through
        case TOUCH_SLOP_DEFAULT:
            mTouchSlop = vc.getScaledTouchSlop();
            break;

        case TOUCH_SLOP_PAGING:
            mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(vc);
            break;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号