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