当前位置:网站首页>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;
}));
边栏推荐
- > Could not create task ‘:app:MyTest.main()‘. > SourceSet with name ‘main‘ not found.问题修复
- Tianlong Babu TLBB series - about items dropped from packages
- Cerebral cortex: directed brain connection recognition widespread functional network abnormalities in Parkinson's disease
- 善用兵者,藏于无形,90 分钟深度讲解最佳推广价值作品
- WorkManager学习一
- QT timer realizes dynamic display of pictures
- 一个程序员的职业生涯到底该怎么规划?
- A high density 256 channel electrode cap for dry EEG
- > Could not create task ‘:app:MyTest. main()‘. > SourceSet with name ‘main‘ not found. Problem repair
- Usage differences between isempty and isblank
猜你喜欢
Pagoda panel MySQL cannot be started
Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 - 上
善用兵者,藏于无形,90 分钟深度讲解最佳推广价值作品
【 conseils 】 obtenir les valeurs des axes X et y de la fonction cdfplot dans MATLAB
硬核,你见过机器人玩“密室逃脱”吗?(附代码)
QT timer realizes dynamic display of pictures
高级 OpenCV:BGR 像素强度图
Those who are good at using soldiers, hide in the invisible, and explain the best promotional value works in depth in 90 minutes
Events and bubbles in the applet of "wechat applet - Basics"
Design and Simulation of fuzzy PID control system for liquid level of double tank (matlab/simulink)
随机推荐
Getting started with Apache dolphin scheduler (one article is enough)
[论文阅读] CKAN: Collaborative Knowledge-aware Atentive Network for Recommender Systems
Meitu lost 300 million yuan in currency speculation for half a year. Huawei was exposed to expand its enrollment in Russia. Alphago's peers have made another breakthrough in chess. Today, more big new
IDEA新建sprintboot项目
【系统设计】指标监控和告警系统
Openes version query
How to plan the career of a programmer?
Coffeescript Chinese character to pinyin code
学习笔记5--高精地图解决方案
Tianlong Babu TLBB series - about items dropped from packages
硬核,你见过机器人玩“密室逃脱”吗?(附代码)
A large number of virtual anchors in station B were collectively forced to refund: revenue evaporated, but they still owe station B; Jobs was posthumously awarded the U.S. presidential medal of freedo
.Net之延迟队列
Tianlong Babu TLBB series - single skill group injury
QT VT100 parser
小程序中自定义行内左滑按钮,类似于qq和wx消息界面那种
Z-blog template installation and use tutorial
Swift tableview style (I) system basic
Fluent generates icon prompt logo widget
> Could not create task ‘:app:MyTest. main()‘. > SourceSet with name ‘main‘ not found. Problem repair