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); } }