How can I understand if the user holds his finger on the screen without moving it?

I am currently using pure OpenGL to draw buttons in my own way.

I can determine if a button is pressed using onTouchEvent, but I want to know if the user holds the button down or the user no longer touches the screen.

+3
source share
1 answer

After the first MotionEvent.ACTION_DOWN event, all subsequent touch events (the user holds his finger on the screen) will be MotionEvent.ACTION_MOVE events until the user extends his finger on the screen, which will be registered as the MotionEvent.ACTION_UP event.

, - , MotionEvent.ACTION_MOVE , , MotionEvent.ACTION_UP .

+5

Source: https://habr.com/ru/post/1763368/


All Articles