Code example for ScaleGestureDetector

Methods: onTouchEvent

0
 
        return true; 
    } 
 
    private void activateScaleDetector(MotionEvent ev) {
        mScaleDetector.onTouchEvent(ev);
    } 
 
    private void updateXYPositionSimpleTouch(MotionEvent ev) {
        mLastTouchX = ev.getX();
        mLastTouchY = ev.getY();
 
    } 
 
    private void updatePointerId(MotionEvent ev) {
        final int pointerIndex = (ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
        final int pointerId = ev.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;