hxb
2022-11-22 b3513b1713bb979d0a69c5a8c4ddcd038f184e6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.mm.android.deviceaddmodule.utils;
 
import android.content.Context;
 
import com.mm.android.deviceaddmodule.mobilecommon.utils.PreferencesHelper;
 
public class LCUtils {
 
    private static long mLastClickTime;
    private static final String DEBUG_STATE = "DEBUG_STATE";
 
    /**
     * 检测是否重复点击事件,默认时间为800毫秒
     *
     * @return
     */
    public static boolean isFastDoubleClick() {
        long time = System.currentTimeMillis();
        long timeD = time - mLastClickTime;
        if (0 < timeD && timeD < 1200) {
            return true;
        }
        mLastClickTime = time;
        return false;
    }
 
    public static boolean isDebug(Context context){
        return  PreferencesHelper.getInstance(context).getBoolean(DEBUG_STATE, false);
    }
 
    public static void setDebug(Context context,boolean debug){
        PreferencesHelper.getInstance(context).set(DEBUG_STATE, debug);
    }
}