private void build(){
  LayoutParams layoutParams=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  int repeatCount=(mRepeat == INFINITE) ? ObjectAnimator.INFINITE : mRepeat;
  List<Animator> animators=new ArrayList<>();
  for (int index=0; index < mCount; index++) {
    PulseView pulseView=new PulseView(getContext());
    pulseView.setScaleX(0);
    pulseView.setScaleY(0);
    pulseView.setAlpha(1);
    addView(pulseView,index,layoutParams);
    mViews.add(pulseView);
    long delay=index * mDuration / mCount;
    ObjectAnimator scaleXAnimator=ObjectAnimator.ofFloat(pulseView,"ScaleX",0f,1f);
    scaleXAnimator.setRepeatCount(repeatCount);
    scaleXAnimator.setRepeatMode(ObjectAnimator.RESTART);
    scaleXAnimator.setStartDelay(delay);
    animators.add(scaleXAnimator);
    ObjectAnimator scaleYAnimator=ObjectAnimator.ofFloat(pulseView,"ScaleY",0f,1f);
    scaleYAnimator.setRepeatCount(repeatCount);
    scaleYAnimator.setRepeatMode(ObjectAnimator.RESTART);
    scaleYAnimator.setStartDelay(delay);
    animators.add(scaleYAnimator);
    ObjectAnimator alphaAnimator=ObjectAnimator.ofFloat(pulseView,"Alpha",1f,0f);
    alphaAnimator.setRepeatCount(repeatCount);
    alphaAnimator.setRepeatMode(ObjectAnimator.RESTART);
    alphaAnimator.setStartDelay(delay);
    animators.add(alphaAnimator);
  }
  mAnimatorSet=new AnimatorSet();
  mAnimatorSet.playTogether(animators);
  mAnimatorSet.setInterpolator(createInterpolator(mInterpolator));
  mAnimatorSet.setDuration(mDuration);
  mAnimatorSet.addListener(mAnimatorListener);
}

private void build ( ) { LayoutParams layoutParams = new LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ; int repeatCount = ( mRepeat == INFINITE ) ? ObjectAnimator . INFINITE : mRepeat ; List < Animator > animators = new ArrayList < > ( ) ; for ( int index = 0 ; index < mCount ; index ++ ) { PulseView pulseView = new PulseView ( getContext ( ) ) ; pulseView . setScaleX ( 0 ) ; pulseView . setScaleY ( 0 ) ; pulseView . setAlpha ( 1 ) ; addView ( pulseView , index , layoutParams ) ; mViews . add ( pulseView ) ; long delay = index * mDuration / mCount ; ObjectAnimator scaleXAnimator = ObjectAnimator . ofFloat ( pulseView , "ScaleX" , 0f , 1f ) ; scaleXAnimator . setRepeatCount ( repeatCount ) ; scaleXAnimator . setRepeatMode ( ObjectAnimator . RESTART ) ; scaleXAnimator . setStartDelay ( delay ) ; animators . add ( scaleXAnimator ) ; ObjectAnimator scaleYAnimator = ObjectAnimator . ofFloat ( pulseView , "ScaleY" , 0f , 1f ) ; scaleYAnimator . setRepeatCount ( repeatCount ) ; scaleYAnimator . setRepeatMode ( ObjectAnimator . RESTART ) ; scaleYAnimator . setStartDelay ( delay ) ; animators . add ( scaleYAnimator ) ; ObjectAnimator alphaAnimator = ObjectAnimator . ofFloat ( pulseView , "Alpha" , 1f , 0f ) ; alphaAnimator . setRepeatCount ( repeatCount ) ; alphaAnimator . setRepeatMode ( ObjectAnimator . RESTART ) ; alphaAnimator . setStartDelay ( delay ) ; animators . add ( alphaAnimator ) ; } mAnimatorSet = new AnimatorSet ( ) ; mAnimatorSet . playTogether ( animators ) ; mAnimatorSet . setInterpolator ( createInterpolator ( mInterpolator ) ) ; mAnimatorSet . setDuration ( mDuration ) ; mAnimatorSet . addListener ( mAnimatorListener ) ; }
build pulse views and animators .
