1

I am trying to fade in the markers on a google maps fragment like this:

ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
animator.setDuration(1000);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
    @Override
    public void onAnimationUpdate(ValueAnimator animation) {
        marker.setAlpha((float) animation.getAnimatedValue());
    }
});
animator.start();

It works perfectly for a single marker but when I try to do it with 200 markers the performance is terrible and the markers just appear without any animation. I'm going nuts here, any help/idea/suggestion would be really appreciated.

j3susalonso
  • 46
  • 1
  • 6

1 Answers1

0

You may want to check on this related SO post. It suggested to use the Interpolator class to apply the animation on the Marker and handle it in the Handler for the animation. Check the sample code snippet.

Here are some threads which might help:

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59