Apply tint to the Volume Dialog primary and supplement icon
BUG: 79437820 Test: manual Change-Id: I7bbb70e83ea4825977f9108f207327cc7b0e3a22
This commit is contained in:
@@ -25,4 +25,7 @@
|
||||
<color name="car_user_switcher_name_text_color">@color/car_body1_light</color>
|
||||
<color name="car_user_switcher_add_user_background_color">@color/car_dark_blue_grey_600</color>
|
||||
<color name="car_user_switcher_add_user_add_sign_color">@color/car_body1_light</color>
|
||||
|
||||
<!-- colors for volume dialog tint -->
|
||||
<color name="car_volume_dialog_tint">@color/car_tint</color>
|
||||
</resources>
|
||||
|
||||
@@ -344,13 +344,17 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
||||
int supplementalIconId, @Nullable View.OnClickListener supplementalIconOnClickListener) {
|
||||
SeekbarListItem listItem = new SeekbarListItem(mContext);
|
||||
listItem.setMax(getMaxSeekbarValue(mCarAudioManager, volumeGroupId));
|
||||
int color = mContext.getResources().getColor(R.color.car_volume_dialog_tint);
|
||||
int progress = getSeekbarValue(mCarAudioManager, volumeGroupId);
|
||||
listItem.setProgress(progress);
|
||||
listItem.setOnSeekBarChangeListener(
|
||||
new CarVolumeDialogImpl.VolumeSeekBarChangeListener(volumeGroupId, mCarAudioManager));
|
||||
listItem.setPrimaryActionIcon(mContext.getResources().getDrawable(volumeItem.icon));
|
||||
Drawable primaryIcon = mContext.getResources().getDrawable(volumeItem.icon);
|
||||
primaryIcon.setTint(color);
|
||||
listItem.setPrimaryActionIcon(primaryIcon);
|
||||
if (supplementalIconId != 0) {
|
||||
Drawable supplementalIcon = mContext.getResources().getDrawable(supplementalIconId);
|
||||
supplementalIcon.setTint(color);
|
||||
listItem.setSupplementalIcon(supplementalIcon, true,
|
||||
supplementalIconOnClickListener);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user