I connected the ScaleGestureDetector to OnTouchListener as described in the Android documentation. For some reason, the ScaleGestureDetector does not always detect the end of a hard clip. This occurs mainly with compression from large to small.
The effect is that after I released both fingers, the detector does not fire the gesture end event. If I touch the screen with one of them, he still thinks that I will continue a large-scale gesture (keeps shooting at Scale events). I have to make another gesture to make the detector catch fire.
I added the logs to OnTouchListener, and when the scale gesture gets stuck, I still get motion events when using one finger, and event.getPointerCount () is 1.
I made sure that I have no other listeners. The view that onTouchListener has is not the only view on the screen, but this effect also occurs when I am very careful to start and finish the gesture inside this one view.
Is there a way to improve end detection?
Or if I have a way to manually set the ScaleGestureDetector to run onScaleEnd and change it scaleGestureDetector.isInProgress()to false?
source
share