Code example for BounceInterpolator

0
            final long start = SystemClock.uptimeMillis();
            final long duration = 1500;
 
            final Interpolator interpolator = new BounceInterpolator();
 
            handler.post(new Runnable() {
                @Override 
                public void run() { 
                    long elapsed = SystemClock.uptimeMillis() - start;
                    float t = Math.max(1 - interpolator
                            .getInterpolation((float) elapsed / duration), 0);
                    marker.setAnchor(0.5f, 1.0f + 2 * t);
 
                    if (t > 0.0) {
                        // Post again 16ms later. 
                        handler.postDelayed(this, 16);
                    } 
                } 
            }); 
        } else if (marker.equals(mAdelaide)) {
            // This causes the marker at Adelaide to change color.