1. 程式人生 > >ButtonUtil:Button 按鈕工具類

ButtonUtil:Button 按鈕工具類

public class ButtonUtil {

    private static long lastClickTime = 0;

    private ButtonUtil(){

    }

    /**
     * 是否連續點選
     * @return
     */
    public static boolean isFastDoubleClick() {
        long time = System.currentTimeMillis();
        if ( time - lastClickTime < 500) {
            return true;
        }
        lastClickTime = time;
        return false;
    }
}