-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
idcardcamera/src/main/java/com/wildma/idcardcamera/utils/CommonUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.wildma.idcardcamera.utils; | ||
|
||
/** | ||
* Author wildma | ||
* Github https://github.com/wildma | ||
* Date 2019/07/16 | ||
* Desc ${公用工具类} | ||
*/ | ||
public class CommonUtils { | ||
|
||
private static long lastClickTime; | ||
|
||
/** | ||
* 判断是否是快速点击 | ||
* | ||
* @return true:是,false:否 | ||
*/ | ||
public static boolean isFastClick() { | ||
return isFastClick(1000); | ||
} | ||
|
||
/** | ||
* 判断是否是快速点击 | ||
* | ||
* @param intervalTime 间隔时间,单位毫秒。 | ||
* @return true:是,false:否 | ||
*/ | ||
public static boolean isFastClick(long intervalTime) { | ||
long time = System.currentTimeMillis(); | ||
if (time - lastClickTime < intervalTime) { | ||
return true; | ||
} | ||
lastClickTime = time; | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters