use of android.support.annotation.ColorRes in project Robot-Scouter by SUPERCILEX.
the class TeamMenuHelper method updateToolbarColor.
private void updateToolbarColor(boolean visible) {
FragmentActivity activity = mFragment.getActivity();
@ColorRes int oldColorPrimary = visible ? R.color.selected_toolbar : R.color.colorPrimary;
@ColorRes int newColorPrimary = visible ? R.color.colorPrimary : R.color.selected_toolbar;
Toolbar toolbar = activity.findViewById(R.id.toolbar);
animateColorChange(mFragment.getContext(), oldColorPrimary, newColorPrimary, animator -> toolbar.setBackgroundColor((int) animator.getAnimatedValue()));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@ColorRes int oldColorPrimaryDark = visible ? R.color.selected_status_bar : R.color.colorPrimaryDark;
@ColorRes int newColorPrimaryDark = visible ? R.color.colorPrimaryDark : R.color.selected_status_bar;
animateColorChange(mFragment.getContext(), oldColorPrimaryDark, newColorPrimaryDark, animator -> activity.getWindow().setStatusBarColor((int) animator.getAnimatedValue()));
}
}
Aggregations