private void sunsetAnimator() {
float sunYStart = mSunView.getTop();
float sunYEnd = mSkyView.getHeight();
ObjectAnimator heightAnimator = ObjectAnimator.ofFloat(mSunView, "y", sunYStart, sunYEnd)
.setDuration(3000);
ObjectAnimator sunsetSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
mBlueSkyColor, mSunsetSkyColor)
.setDuration(3000);
ObjectAnimator nightSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
mSunsetSkyColor, mNightSkyColor)
.setDuration(1500);
heightAnimator.setInterpolator(new AccelerateInterpolator());
sunsetSkyAnimator.setEvaluator(new ArgbEvaluator());
nightSkyAnimator.setEvaluator(new ArgbEvaluator());
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(heightAnimator).with(sunsetSkyAnimator).before(nightSkyAnimator);
animatorSet.start();
}
SunsetFragment.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:Android-Programming-BigNerd
作者:
评论列表
文章目录