According to Android Developers:
(根据Android开发人员的说法:)
onLongPress
Notified when a long press occurs with the initial on down MotionEvent that trigged it.
(onLongPress
在长onLongPress
触发了它的初始onLongPress
通知。)
onShowPress
The user has performed a down MotionEvent and not performed a move or up yet.
(onShowPress
用户已执行了onShowPress
的下移,但尚未执行上移或上移。)
This event is commonly used to provide visual feedback to the user to let them know that their action has been recognized ie highlight an element. (此事件通常用于向用户提供视觉反馈,以使他们知道其动作已被识别,即突出显示元素。)
I tried both with a button and used a Toast
to indicate that showPress
and longPress
happened.
(我有一个按钮尝试都和使用Toast
,表明showPress
和longPress
发生。)
However, I don't see any difference. (但是,我看不出任何区别。)
What's the difference between onLongPress
and onShowPress
?
(onLongPress
和onShowPress
什么onShowPress
?)
What are some examples when we override
GestureDetector
for those MotionEvents
? (什么是一些例子,当我们override
GestureDetector
那些MotionEvents
?)
ask by Richard translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…