防止重复点击工具类

package com.che.lovecar.ui.home;

/**
 * 防止重复点击工具类
 * <p>
 * 作者:余天然 on 16/9/12 下午7:15
 */
public class FastClickUtil {
    private static long lastClickTime;

    public static boolean isRepeatClick() {
        long time = System.currentTimeMillis();

        if (time - lastClickTime < 500) {
            return true;
        }
        lastClickTime = time;

        return false;
    }

    public static boolean isRepeatClick(long delay) {
        long time = System.currentTimeMillis();

        if (time - lastClickTime < delay) {
            return true;
        }
        lastClickTime = time;
        return false;
    }
}
2016-10-28 13:297