GoogleMapsBottomSheetBehavior.java 文件源码

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

项目:Google-Maps-BottomSheet 作者:
private void updateHeaderColor(int newBackgroundColor, int newTextColor) {
    if (mCurrentColor != newBackgroundColor) {
        if (colorAnimation != null && colorAnimation.isRunning()) {
            colorAnimation.cancel();
        }
        if (headerLayout != null) {
            final int DURATION = 200;
            colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), mCurrentColor, newBackgroundColor).setDuration(DURATION);
            mCurrentColor = newBackgroundColor;
            colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator valueAnimator) {
                    headerLayout.setBackgroundColor((int) valueAnimator.getAnimatedValue());
                }
            });
            colorAnimation.start();

            for (int i = 0, size = headerTextViews.size(); i < size; i++) {
                animateTextColorChange(newTextColor, DURATION, headerTextViews.get(i));
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号