當前位置: 首頁>>代碼示例>>Java>>正文


Java ValueAnimator.setStartDelay方法代碼示例

本文整理匯總了Java中android.animation.ValueAnimator.setStartDelay方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueAnimator.setStartDelay方法的具體用法?Java ValueAnimator.setStartDelay怎麽用?Java ValueAnimator.setStartDelay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.animation.ValueAnimator的用法示例。


在下文中一共展示了ValueAnimator.setStartDelay方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUpAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override public void setUpAnimation() {
  for (int i = 0; i < numberOfLines; i++) {
    final int index = i;
    ValueAnimator scaleAnimator = ValueAnimator.ofFloat(1f, 1.5f, 1f);
    scaleAnimator.setDuration(1000);
    scaleAnimator.setStartDelay(i * 120);
    scaleAnimator.setRepeatCount(ValueAnimator.INFINITE);
    scaleAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
      @Override public void onAnimationUpdate(ValueAnimator animation) {
        scaleY[index] = (float)animation.getAnimatedValue();
        if (invalidateListener != null) {
          invalidateListener.reDraw();
        }
      }
    });

    scaleAnimator.start();
  }
}
 
開發者ID:nntuyen,項目名稱:mkloader,代碼行數:20,代碼來源:Pulse.java

示例2: createAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    long[] delays=new long[]{500,250,0,250,500};
    for (int i = 0; i < 5; i++) {
        final int index=i;
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.3f,1);
        scaleAnim.setDuration(900);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleYFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:magicbaby810,項目名稱:SRecyclerView,代碼行數:23,代碼來源:LineScalePulseOutIndicator.java

示例3: createAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> 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]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleYFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:leobert-lan,項目名稱:UiLib,代碼行數:23,代碼來源:LineScalePulseOutRapidIndicator.java

示例4: createAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();

    int[] durations={960, 930, 1190, 1130, 1340, 940, 1200, 820, 1190};
    int[] delays= {360, 400, 680, 410, 710, -150, -120, 10, 320};

    for (int i = 0; i < 9; i++) {
        final int index=i;
        ValueAnimator alphaAnim=ValueAnimator.ofInt(255, 168,255);
        alphaAnim.setDuration(durations[i]);
        alphaAnim.setRepeatCount(-1);
        alphaAnim.setStartDelay(delays[i]);
        alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                alphas[index] = (int) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        alphaAnim.start();
        animators.add(alphaAnim);
    }
    return animators;
}
 
開發者ID:Mrqinlei,項目名稱:ImitateZHRB,代碼行數:26,代碼來源:BallGridBeatIndicator.java

示例5: createAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    long[] delays=new long[]{100,200,300,400,500};
    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]);
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleYFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:Mrqinlei,項目名稱:ImitateZHRB,代碼行數:23,代碼來源:LineScaleIndicator.java

示例6: setUpAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override public void setUpAnimation() {
  for (int i = 0; i < numberOfArc; i++) {
    final int index = i;

    ValueAnimator fadeAnimator = ValueAnimator.ofInt(126, 255, 126);
    fadeAnimator.setRepeatCount(ValueAnimator.INFINITE);
    fadeAnimator.setDuration(1000);
    fadeAnimator.setStartDelay(i * 120);
    fadeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
      @Override public void onAnimationUpdate(ValueAnimator animation) {
        arcs[index].setAlpha((int)animation.getAnimatedValue());
        if (invalidateListener != null) {
          invalidateListener.reDraw();
        }
      }
    });

    fadeAnimator.start();
  }
}
 
開發者ID:nntuyen,項目名稱:mkloader,代碼行數:21,代碼來源:PhoneWave.java

示例7: createAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public List<Animator> createAnimation() {
    List<Animator> animators=new ArrayList<>();
    int[] delays=new int[]{120,240,360};
    for (int i = 0; i < 3; i++) {
        final int index=i;
        
        ValueAnimator scaleAnim=ValueAnimator.ofFloat(1,0.3f,1);
        
        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);
        
        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();

            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:zhouphenix,項目名稱:Multi-SwipeToRefreshLayout,代碼行數:27,代碼來源:BallPulseIndicator.java

示例8: createAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
public List<Animator> createAnimation() {
    List<Animator> animators = new ArrayList<>();
    int[] delays = new int[]{120, 240, 360};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.3f, 1);

        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);

        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();

            }
        });
        scaleAnim.start();
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:26,代碼來源:ProgressIndicatorView.java

示例9: createBallPulseAnimators

import android.animation.ValueAnimator; //導入方法依賴的package包/類
public ArrayList<ValueAnimator> createBallPulseAnimators() {
    ArrayList<ValueAnimator> animators = new ArrayList<>();
    int[] delays = new int[]{120, 240, 360};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.3f, 1);

        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);

        scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:hiwhitley,項目名稱:DownloadProgressButton,代碼行數:24,代碼來源:DownloadProgressButton.java

示例10: setUpAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override public void setUpAnimation() {
  for (int i = 0; i < numberOfCircle; i++) {
    final int index = i;

    ValueAnimator fadeAnimator = ValueAnimator.ofFloat(0, 360);
    fadeAnimator.setRepeatCount(ValueAnimator.INFINITE);
    fadeAnimator.setDuration(1700);
    fadeAnimator.setStartDelay(index * 100);
    fadeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
      @Override public void onAnimationUpdate(ValueAnimator animation) {
        rotates[index] = (float)animation.getAnimatedValue();
        if (invalidateListener != null) {
          invalidateListener.reDraw();
        }
      }
    });

    fadeAnimator.start();
  }
}
 
開發者ID:nntuyen,項目名稱:mkloader,代碼行數:21,代碼來源:FishSpinner.java

示例11: onCreateAnimators

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public ArrayList<ValueAnimator> onCreateAnimators() {
    ArrayList<ValueAnimator> animators = new ArrayList<>();
    int[] delays = new int[]{120, 240, 360};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator scaleAnim = ValueAnimator.ofFloat(1, 0.3f, 1);

        scaleAnim.setDuration(750);
        scaleAnim.setRepeatCount(-1);
        scaleAnim.setStartDelay(delays[i]);

        addUpdateListener(scaleAnim, new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                scaleFloats[index] = (float) animation.getAnimatedValue();
                postInvalidate();
            }
        });
        animators.add(scaleAnim);
    }
    return animators;
}
 
開發者ID:yedashen,項目名稱:UltimateRecyclerView,代碼行數:25,代碼來源:BallPulseIndicator.java

示例12: start

import android.animation.ValueAnimator; //導入方法依賴的package包/類
public ShapeAnimator start(){
    //do not use AnimatorSet because you cannot use setRepeatCount
    for (ValueAnimator animator : animators) {
        animator.setRepeatCount(repeatCount);
        animator.setDuration(duration);
        animator.setStartDelay(startDelay);
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                if (view != null) {
                    view.postInvalidate();
                }
            }
        });
        animator.start();
    }
    return this;
}
 
開發者ID:florent37,項目名稱:MyLittleCanvas,代碼行數:19,代碼來源:ShapeAnimator.java

示例13: onCreateAnimators

import android.animation.ValueAnimator; //導入方法依賴的package包/類
@Override
public HashMap<ValueAnimator, ValueAnimator.AnimatorUpdateListener> onCreateAnimators() {
    HashMap<ValueAnimator, ValueAnimator.AnimatorUpdateListener> animators = new HashMap<>();
    final int[] delays = new int[] {ONE_THIRD_DURATION, TWO_THIRD_DURATION, 0};
    for (int i = 0; i < 3; i++) {
        final int index = i;

        ValueAnimator alphaAnim = ValueAnimator.ofInt(ALPHA_FULL, ALPHA_TRANSPARENT, ALPHA_TRANSPARENT);
        alphaAnim.setDuration(DURATION);
        alphaAnim.setRepeatCount(-1);
        alphaAnim.setStartDelay(delays[i]);
        ValueAnimator.AnimatorUpdateListener updateListener = new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                alphas[index] = (int) animation.getAnimatedValue();
                invalidateSelf();
            }
        };
        animators.put(alphaAnim, updateListener);
    }
    return animators;
}
 
開發者ID:Adyen,項目名稱:adyen-android,代碼行數:23,代碼來源:ThreeDotsLoadingAnimation.java

示例14: createNewAppBounceAnimation

import android.animation.ValueAnimator; //導入方法依賴的package包/類
private ValueAnimator createNewAppBounceAnimation(View v, int i) {
    ValueAnimator bounceAnim = LauncherAnimUtils.ofViewAlphaAndScale(v, 1, 1, 1);
    bounceAnim.setDuration(InstallShortcutReceiver.NEW_SHORTCUT_BOUNCE_DURATION);
    bounceAnim.setStartDelay(i * InstallShortcutReceiver.NEW_SHORTCUT_STAGGER_DELAY);
    bounceAnim.setInterpolator(new OvershootInterpolator(BOUNCE_ANIMATION_TENSION));
    return bounceAnim;
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:8,代碼來源:Launcher.java

示例15: startAnim

import android.animation.ValueAnimator; //導入方法依賴的package包/類
public void startAnim() {
    RectF startRect = new RectF(targetSize.centerX(), targetSize.centerY(), targetSize.centerX(), targetSize.centerY());
    ValueAnimator rectSize = ValueAnimator.ofObject(new RectFEvaluator(), startRect, targetSize);
    rectSize.setDuration(animDuration);
    rectSize.setInterpolator(new QuintOut());
    rectSize.setStartDelay(startDelay);
    rectSize.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            drawingRect = (RectF) animation.getAnimatedValue();
            invalidate();
        }
    });
    rectSize.start();
}
 
開發者ID:florent37,項目名稱:Depth,代碼行數:16,代碼來源:CircularSplashView.java


注:本文中的android.animation.ValueAnimator.setStartDelay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。