Android - Adding Scale animation to cluster marker?

184 views Asked by At

I have implemented google map clusters and i want scale animation in the marker clusters, please see the video, i want the same animation which is present in the video. I have tried the animation but it is not playing the same. I am posting my code.

private void animateMarkerDropping(final Marker marker) {

        final Handler handler = new Handler();
        final long start = SystemClock.uptimeMillis();
        final long duration = 800;

        final Interpolator interpolator = new AccelerateInterpolator();

        handler.post(new Runnable() {
            @Override
            public void run() {
                final long elapsed = SystemClock.uptimeMillis() - start;
                final float t = Math.max(1 -
                        interpolator.getInterpolation((float) elapsed / duration), 0);

                //Log.e("---t----",""+t);
                marker.setAnchor(0.5f, 1f + 14 * t);

                if (t > 0f) {
                    handler.postDelayed(this, 15);
                }
            }
        });
    }

My requirement is : please see the video. https://files.fm/f/vtg2pge5

0

There are 0 answers