SunsetFragment.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:Android-Programming-BigNerd 作者:
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();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号