package
com.plusub.renthostapp.util;
/**
* package: com.plusub.renthostapp.util
* Created by noyet on 2015/11/26.
*/
public
class
NoDoubleClickUtils {
private
static
long
lastClickTime;
private
final
static
int
SPACE_TIME =
500
;
public
static
void
initLastClickTime() {
lastClickTime =
0
;
}
public
synchronized
static
boolean
isDoubleClick() {
long
currentTime = System.currentTimeMillis();
boolean
isClick2;
if
(currentTime - lastClickTime > SPACE_TIME) {
isClick2 =
false
;
}
else
{
isClick2 =
true
;
}
lastClickTime = currentTime;
return
isClick2;
}
}
联系客服