当前位置:网站首页>Write double click event
Write double click event
2022-07-05 10:16:00 【asahi_ xin】
public class OnDoubleClickListener implements View.OnTouchListener {
private DoubleClickCallback clickCallback;
private long lastClickTime;
public OnDoubleClickListener(DoubleClickCallback clickCallback) {
this.clickCallback = clickCallback;
}
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
long longDate = TimeUtils.getLongDate();
int len = 500;
if (longDate - lastClickTime < len) {
clickCallback.onTouch(v, event);
}
lastClickTime = longDate;
}
return false;
}
public interface DoubleClickCallback {
boolean onTouch(View v, MotionEvent event);
}
}
call
text.setOnTouchListener(new OnDoubleClickListener((v, event) -> {
//todo
return false;
}));
边栏推荐
- 微信小程序中,从一个页面跳转到另一个页面后,在返回后发现页面同步滚动了
- [200 opencv routines] 219 Add digital watermark (blind watermark)
- Energy momentum: how to achieve carbon neutralization in the power industry?
- The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
- 官网给的这个依赖是不是应该为flink-sql-connector-mysql-cdc啊,加了依赖调
- 《剑来》语句摘录(七)
- 【 conseils 】 obtenir les valeurs des axes X et y de la fonction cdfplot dans MATLAB
- oracle和mysql批量Merge对比
- 一种用于干式脑电图的高密度256通道电极帽
- WorkManager的学习二
猜你喜欢

Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常

Cent7 Oracle database installation error
![[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems](/img/6c/5b14f47503033bc2c85a259a968d94.png)
[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems

最全是一次I2C总结

基于单片机步进电机控制器设计(正转反转指示灯挡位)

Coordinate system of view

Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 - 上

硬核,你见过机器人玩“密室逃脱”吗?(附代码)

【 conseils 】 obtenir les valeurs des axes X et y de la fonction cdfplot dans MATLAB

WorkManager学习一
随机推荐
Glide advanced level
天龙八部TLBB系列 - 单体技能群伤
QT event filter simple case
B站大量虚拟主播被集体强制退款:收入蒸发,还倒欠B站;乔布斯被追授美国总统自由勋章;Grafana 9 发布|极客头条...
The essence of persuasion is to remove obstacles
宝塔面板MySQL无法启动
StaticLayout的使用详解
@Jsonadapter annotation usage
uniapp + uniCloud+unipay 实现微信小程序支付功能
Swift set pickerview to white on black background
Jupiter notebook shortcut key
Is it really reliable for AI to make complex decisions for enterprises? Participate in the live broadcast, Dr. Stanford to share his choice | qubit · viewpoint
Design and Simulation of fuzzy PID control system for liquid level of double tank (matlab/simulink)
> Could not create task ‘:app:MyTest. main()‘. > SourceSet with name ‘main‘ not found. Problem repair
AtCoder Beginner Contest 258「ABCDEFG」
Comparison of batch merge between Oracle and MySQL
QT realizes signal transmission and reception between two windows
ArcGIS Pro 创建要素
Cerebral cortex: directed brain connection recognition widespread functional network abnormalities in Parkinson's disease
. Net delay queue