@Override
    public boolean onTouchEvent(MotionEvent event) {
        if (!mCubicPath && !mQuadraticPath) {
            return false;
        }
        int action = event.getAction();
        float scaledX = (event.getX() - (getWidth() * (1 - SCALE_FACTOR) / 2)) / SCALE_FACTOR;
        float scaledY = (event.getY() - (getHeight() * (1 - SCALE_FACTOR) / 2)) / SCALE_FACTOR;
        float x = Math.max(Math.min(scaledX / getWidth(), 1), 0);
        float y = Math.max(Math.min((1 - scaledY / getHeight()), 1), 0);
        boolean handled = false;
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                if (Math.abs(x - mCx1) < .05f && Math.abs(y - mCy1) < .05f) {
                    mMovingC1 = true;
                    handled = true;
                } else if (mCubicPath && Math.abs(x - mCx2) < .05f && Math.abs(y - mCy2) < .05f) {
                    mMovingC2 = true;
                    handled = true;
                }
                break;
            case MotionEvent.ACTION_MOVE:
                if (mMovingC1) {
                    mCx1 = x;
                    mCy1 = y;
                    if (mPathCallback != null) {
                        mPathCallback.onControlPoint1Moved(x, y);
                    }
                } else if (mMovingC2) {
                    mCx2 = x;
                    mCy2 = y;
                    if (mPathCallback != null) {
                        mPathCallback.onControlPoint2Moved(x, y);
                    }
                }
                setupPathInterpolator();
                handled = true;
                break;
            case MotionEvent.ACTION_UP:
                handled = true;
                mMovingC1 = mMovingC2 = false;
                break;
        }
        if (handled) {
            invalidate();
        }
        return handled;
    }
This override allows the control points for PathInterpolators to be moved by the
user, by dragging them into new positions.

{@inheritDoc}
AnimationsInterpolatorPlayground/app/src/main/java/com/example/android/interpolatorplayground/CurveVisualizer.java