car/src/main/java/androidx/car/widget/PagedScrollBarView.java
@SuppressWarnings("deprecation")
    private void reloadColors() {
        int tintResId;
        int thumbColorResId;
        int upDownBackgroundResId;

        switch (mDayNightStyle) {
            case DayNightStyle.AUTO:
                tintResId = R.color.car_tint;
                thumbColorResId = R.color.car_scrollbar_thumb;
                upDownBackgroundResId = R.drawable.car_button_ripple_background;
                break;
            case DayNightStyle.AUTO_INVERSE:
                tintResId = R.color.car_tint_inverse;
                thumbColorResId = R.color.car_scrollbar_thumb_inverse;
                upDownBackgroundResId = R.drawable.car_button_ripple_background_inverse;
                break;
            case DayNightStyle.FORCE_NIGHT:
            case DayNightStyle.ALWAYS_LIGHT:
                tintResId = R.color.car_tint_light;
                thumbColorResId = R.color.car_scrollbar_thumb_light;
                upDownBackgroundResId = R.drawable.car_button_ripple_background_night;
                break;
            case DayNightStyle.FORCE_DAY:
            case DayNightStyle.ALWAYS_DARK:
                tintResId = R.color.car_tint_dark;
                thumbColorResId = R.color.car_scrollbar_thumb_dark;
                upDownBackgroundResId = R.drawable.car_button_ripple_background_day;
                break;
            default:
                throw new IllegalArgumentException("Unknown DayNightStyle: " + mDayNightStyle);
        }

        if (mUseCustomThumbBackground) {
            thumbColorResId = mCustomThumbBackgroundResId;
        }

        setScrollbarThumbColor(thumbColorResId);

        int tint = ContextCompat.getColor(getContext(), tintResId);
        mUpButton.setColorFilter(tint, PorterDuff.Mode.SRC_IN);
        mUpButton.setBackgroundResource(upDownBackgroundResId);

        mDownButton.setColorFilter(tint, PorterDuff.Mode.SRC_IN);
        mDownButton.setBackgroundResource(upDownBackgroundResId);

        mAlphaJumpButton.setBackgroundResource(upDownBackgroundResId);
    }
/** Reload the colors for the current {@link DayNightStyle}. */
Reload the colors for the current  DayNightStyle.
Reload the colors for the current DayNightStyle .
@SuppressWarnings("deprecation")
    private void reloadColors() {
        int tintResId;
        int thumbColorResId;
        int upDownBackgroundResId;
        switch (mDayNightStyle) {
            case DayNightStyle.AUTO:
                tintResId = R.color.car_tint;
                thumbColorResId = R.color.car_scrollbar_thumb;
                upDownBackgroundResId = R.drawable.car_button_ripple_background;
                break;
            case DayNightStyle.AUTO_INVERSE:
                tintResId = R.color.car_tint_inverse;
                thumbColorResId = R.color.car_scrollbar_thumb_inverse;
                upDownBackgroundResId = R.drawable.car_button_ripple_background_inverse;
                break;
            case DayNightStyle.FORCE_NIGHT:
            case DayNightStyle.ALWAYS_LIGHT:
                tintResId = R.color.car_tint_light;
                thumbColorResId = R.color.car_scrollbar_thumb_light;
                upDownBackgroundResId = R.drawable.car_button_ripple_background_night;
                break;
            case DayNightStyle.FORCE_DAY:
            case DayNightStyle.ALWAYS_DARK:
                tintResId = R.color.car_tint_dark;
                thumbColorResId = R.color.car_scrollbar_thumb_dark;
                upDownBackgroundResId = R.drawable.car_button_ripple_background_day;
                break;
            default:
                throw new IllegalArgumentException("Unknown DayNightStyle: " + mDayNightStyle);
        }
        if (mUseCustomThumbBackground) {
            thumbColorResId = mCustomThumbBackgroundResId;
        }
        setScrollbarThumbColor(thumbColorResId);
        int tint = ContextCompat.getColor(getContext(), tintResId);
        mUpButton.setColorFilter(tint, PorterDuff.Mode.SRC_IN);
        mUpButton.setBackgroundResource(upDownBackgroundResId);
        mDownButton.setColorFilter(tint, PorterDuff.Mode.SRC_IN);
        mDownButton.setBackgroundResource(upDownBackgroundResId);
        mAlphaJumpButton.setBackgroundResource(upDownBackgroundResId);
    }
@ SuppressWarnings ( "deprecation" ) private void reloadColors ( ) { int tintResId ; int thumbColorResId ; int upDownBackgroundResId ; switch ( mDayNightStyle ) { case DayNightStyle . AUTO : tintResId = R . color . car_tint ; thumbColorResId = R . color . car_scrollbar_thumb ; upDownBackgroundResId = R . drawable . car_button_ripple_background ; break ; case DayNightStyle . AUTO_INVERSE : tintResId = R . color . car_tint_inverse ; thumbColorResId = R . color . car_scrollbar_thumb_inverse ; upDownBackgroundResId = R . drawable . car_button_ripple_background_inverse ; break ; case DayNightStyle . FORCE_NIGHT : case DayNightStyle . ALWAYS_LIGHT : tintResId = R . color . car_tint_light ; thumbColorResId = R . color . car_scrollbar_thumb_light ; upDownBackgroundResId = R . drawable . car_button_ripple_background_night ; break ; case DayNightStyle . FORCE_DAY : case DayNightStyle . ALWAYS_DARK : tintResId = R . color . car_tint_dark ; thumbColorResId = R . color . car_scrollbar_thumb_dark ; upDownBackgroundResId = R . drawable . car_button_ripple_background_day ; break ; default : throw new IllegalArgumentException ( "Unknown DayNightStyle: " + mDayNightStyle ) ; } if ( mUseCustomThumbBackground ) { thumbColorResId = mCustomThumbBackgroundResId ; } setScrollbarThumbColor ( thumbColorResId ) ; int tint = ContextCompat . getColor ( getContext ( ) , tintResId ) ; mUpButton . setColorFilter ( tint , PorterDuff . Mode . SRC_IN ) ; mUpButton . setBackgroundResource ( upDownBackgroundResId ) ; mDownButton . setColorFilter ( tint , PorterDuff . Mode . SRC_IN ) ; mDownButton . setBackgroundResource ( upDownBackgroundResId ) ; mAlphaJumpButton . setBackgroundResource ( upDownBackgroundResId ) ; }
Reload the colors for the current {@link DayNightStyle}.
Reload the colors for the current { @link DayNightStyle } .