@Override
    protected void onDraw(Canvas canvas) {
        final int width = getWidth();
        final int height = getHeight();

        // Draw everything smaller to account for drawing the curve and animated object
        // outside the 1x1 grid
        canvas.translate(width * (1 - CurveVisualizer.SCALE_FACTOR) / 2,
                height * (1 - CurveVisualizer.SCALE_FACTOR) / 2);
        canvas.scale(CurveVisualizer.SCALE_FACTOR, CurveVisualizer.SCALE_FACTOR);

        canvas.drawCircle(mBallLeft, mBallTop + mFraction * mBallHeight, RADIUS, mPaint);
        canvas.drawCircle(mBallLeft + mFraction * mBallWidth, mBallTop, RADIUS, mPaint);
    }
This view displays two objects sliding right and down while the animation runs.
The setFraction() method is called by the animation, which causes the view to
invalidate and draw the objects in their new positions.
AnimationsInterpolatorPlayground/app/src/main/java/com/example/android/interpolatorplayground/TimingVisualizer.java