ValueAnimator valueAnimator = ValueAnimator.ofFloat(0f, 1f);
valueAnimator.setDuration(2000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
System.out.println(value);
}
});
valueAnimator.start();
progressBar = findViewById(R.id.progressBar);
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(progressBar, "progress", 0, 100);
objectAnimator.setDuration(10000);
objectAnimator.start();
Android开发之属性动画
最新推荐文章于 2024-08-22 10:14:23 发布