package com.github.jdsjlzx.progressindicator.indicators; import android.animation.ValueAnimator; import java.util.ArrayList; /** * Created by Jack on 2015/10/19. */ public class LineScalePulseOutRapidIndicator extends LineScaleIndicator { @Override public ArrayList<ValueAnimator> onCreateAnimators() { ArrayList<ValueAnimator> animators=new ArrayList<>(); long[] delays=new long[]{400,200,0,200,400}; for (int i = 0; i < 5; i++) { final int index=i; ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.4f,1); scaleAnim.setDuration(1000); scaleAnim.setRepeatCount(-1); scaleAnim.setStartDelay(delays[i]); addUpdateListener(scaleAnim,new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { scaleYFloats[index] = (float) animation.getAnimatedValue(); postInvalidate(); } }); animators.add(scaleAnim); } return animators; } }