Answer the question
In order to leave comments, you need to log in
How to catch onTouchEvent(Kotlin) during another one?
The user touches the screen, when they release their finger, the animation starts running in a loop inside MotionEvent.ACTION_UP . How to make it so that when you touch the screen again, the animation is interrupted? They write that the touches work in the MainThread and until the cycle ends, I will not be able to catch new clicks. So how do you get out of the situation?
PS everything happens inside a custom SurfaceView
Answer the question
In order to leave comments, you need to log in
move the animation to a separate thread. For example, through AsyncTask. And keep a link to it. And when catching a touch - cancel by link
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question