package com.matao.common.util;

import android.content.Context;
import android.view.ViewConfiguration;

/**
 * Created by matao on 2016-12-11 17:51
 * <p>
 * ViewConfigurationUtils提供了一些自定义控件用到的标准常量，比如尺寸大小，滑动距离，敏感度等等。
 */
public class ViewConfigurationUtils {
    private ViewConfigurationUtils() {
        throw new AssertionError("ViewConfigurationUtils cannot be instantiated!");
    }

    /**
     * 获取系统所能识别出的被认为是滑动的最小距离
     *
     * @param context
     * @return
     */
    public static int getScaledTouchSlop(Context context) {
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        return viewConfiguration.getScaledTouchSlop();
    }

    /**
     * 获取Fling速度最小值
     *
     * @param context
     * @return
     */
    public static int getScaledMinimumFlingVelocity(Context context) {
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        return viewConfiguration.getScaledMinimumFlingVelocity();
    }

    /**
     * 获取Fling速度最大值
     *
     * @param context
     * @return
     */
    public static int getScaledMaximumFlingVelocity(Context context) {
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        return viewConfiguration.getScaledMaximumFlingVelocity();
    }

    /**
     * 判断是否有物理Menu按键
     * Android3.0以后物理Menu键取消
     *
     * @param context
     * @return
     */
    public static boolean hasPermanentMenuKey(Context context) {
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        return viewConfiguration.hasPermanentMenuKey();
    }
}

@@ -1589,11 +1589,524 @@
 );%0A    %7D
+%0A%0A    /**%0A     * %E5%8F%8C%E5%87%BB%E9%97%B4%E9%9A%94%E6%97%B6%E9%97%B4.%E5%9C%A8%E8%AF%A5%E6%97%B6%E9%97%B4%E5%86%85%E6%98%AF%E5%8F%8C%E5%87%BB%EF%BC%8C%E5%90%A6%E5%88%99%E6%98%AF%E5%8D%95%E5%87%BB%0A     *%0A     * @return%0A     */%0A    public static int getDoubleTapTimeout() %7B%0A        return ViewConfiguration.getDoubleTapTimeout();%0A    %7D%0A%0A    /**%0A     * %E6%8C%89%E4%BD%8F%E5%90%8E%EF%BC%8C%E7%8A%B6%E6%80%81%E8%BD%AC%E5%8F%98%E4%B8%BA%E9%95%BF%E6%8C%89%E7%8A%B6%E6%80%81%E9%9C%80%E8%A6%81%E7%9A%84%E6%97%B6%E9%97%B4%0A     *%0A     * @return%0A     */%0A    public static int getLongPressTimeout() %7B%0A        return ViewConfiguration.getLongPressTimeout();%0A    %7D%0A%0A    /**%0A     * %E9%87%8D%E5%A4%8D%E6%8C%89%E9%94%AE%E7%9A%84%E9%97%B4%E9%9A%94%E6%97%B6%E9%97%B4%0A     *%0A     * @return%0A     */%0A    public static int getKeyRepeatTimeout() %7B%0A        return ViewConfiguration.getKeyRepeatTimeout();%0A    %7D
 %0A%7D%0A

Revise ViewConfigurationUtils