I followed this great sample to handle the multi touch : https://android-developers.googleblog.com/2010/06/making-sense-of-multitouch.html :
pointerIndex = (action & MotionEvent.ACTION_POINTER_INDEX_MASK)
>> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
final int pointerId = event.getPointerId(pointerIndex);
if (pointerId == mActivePointerId) {
// This was our active pointer going up. Choose a new
// active pointer and adjust accordingly.
final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
lastX = event.getX(newPointerIndex);
lastY = event.getY(newPointerIndex);
mActivePointerId = event.getPointerId(newPointerIndex);
}
Here pointer ids are handled with getX() and getY() which is working great.
But in my use case I have to scale the view inside the MotionEvent.ACTION_MOVE
with setScaleX(). The problem I'm facing is exactly the same that the one here :
Why motionEvent.getX() return inconsistent values, when using setScaleX()?
My retrieved values are jumping with setScaleX()
because of the coordinates.
Then I tried to achieve it with event.getRawX()
which solved the jumping issue during the scale.
I'm now asking how to reproduce the same logic used for getX()
to handle the multi touch with getRawX()
? Or any workaround