Code example for MotionEvent

Methods: findPointerIndexgetXgetY

0
        old_degrees = -(int) Math.toDegrees(r);
    } 
 
    public void updatePositionToMoveTheImage(MotionEvent event) {
 
        final int pointerIndex = event.findPointerIndex(mActivePointerId);
        final float x = event.getX(pointerIndex);
        final float y = event.getY(pointerIndex);
 
        if (!mScaleDetector.isInProgress()) {
 
            final float dx = x - mLastTouchX;
            final float dy = y - mLastTouchY;
 
            mPosX += dx;
            mPosY += dy;
 
            invalidate();
        } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE