The function of gesture sliding developed by Android

The function of gesture sliding developed by Android

First, the activity must implement the ongesturelistener interface, which provides some methods for gesture operation,

Ondown method: ondown means that once the touch screen is pressed, an ondown event will be generated immediately

Onlongpress method: triggered when long pressing the screen

Onscroll method: triggered when the hand slides away from the screen. The parameters are the same as onfling (note the difference between the two)

Onshowpress method: click the touch screen, but there is no move or pop-up action. The difference between onshowpress and ondown is that once the touch screen is pressed, an ondown event will be generated immediately, but onshowpress is an onshowpress event after the ondown event is generated. For a period of time, if there is no move of the mouse and pop-up event, it will be considered an onshowpress event.

Onsingletapup method: tap the touch screen and pop up. If onlongpress, onscroll and onfling events are generated in this process, onsingletapup events will not be generated.

If you have any questions, please leave a message or go to the community of this site for exchange and discussion. Thank you for reading. I hope it can help you. Thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>