偷懒代码块之快速双击判断工具

public class Utils {

        private static long lastClickTime = 0;
        private boolean isFastClick(){
            long previous = System.currentTimeMillis();
            long current = previous - lastClickTime;
            if (current < 500 && current > 0) {
                return true;
            }
            lastClickTime = previous;
            return false;
        }
    }

你可能感兴趣的:(偷懒代码块之快速双击判断工具)