package com.gingersoft.gsa.cloud.base.utils;

/**
 * 作者：ELEGANT_BIN
 * 版本：1.6.0
 * 创建日期：2018/12/18
 * 修订历史：2018/12/18
 * 描述：
 */
public class ViewUtils {

    // 两次点击按钮之间的点击间隔不能少于800毫秒
    private static long lastClickTime;

    //两次点击按钮之间的点击间隔不能少于200毫秒，防止快速点击食品导致不同步问题
    private static final int MIN_CLICK_DELAY_TIME2 = 200;
    private static final int MIN_CLICK_DELAY_TIME5 = 500;

    public static boolean isFastClick5() {
        boolean flag = false;
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME5) {
            flag = true;
        }
        lastClickTime = curClickTime;
        return flag;
    }

    public static boolean isFastClick2() {
        boolean flag = false;
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME2) {
            flag = true;
        }
        lastClickTime = curClickTime;
        return flag;
    }

}
