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));
}
}
}
}
GoogleMapsBottomSheetBehavior.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:Google-Maps-BottomSheet
作者:
评论列表
文章目录