Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4651a6cb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Apply tint to the Volume Dialog primary and supplement icon" into pi-dev

parents c4e19963 a412b456
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -25,4 +25,7 @@
    <color name="car_user_switcher_name_text_color">@color/car_body1_light</color>
    <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_background_color">@color/car_dark_blue_grey_600</color>
    <color name="car_user_switcher_add_user_add_sign_color">@color/car_body1_light</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>
</resources>
+5 −1
Original line number Original line Diff line number Diff line
@@ -344,13 +344,17 @@ public class CarVolumeDialogImpl implements VolumeDialog {
      int supplementalIconId, @Nullable View.OnClickListener supplementalIconOnClickListener) {
      int supplementalIconId, @Nullable View.OnClickListener supplementalIconOnClickListener) {
    SeekbarListItem listItem = new SeekbarListItem(mContext);
    SeekbarListItem listItem = new SeekbarListItem(mContext);
    listItem.setMax(getMaxSeekbarValue(mCarAudioManager, volumeGroupId));
    listItem.setMax(getMaxSeekbarValue(mCarAudioManager, volumeGroupId));
    int color = mContext.getResources().getColor(R.color.car_volume_dialog_tint);
    int progress = getSeekbarValue(mCarAudioManager, volumeGroupId);
    int progress = getSeekbarValue(mCarAudioManager, volumeGroupId);
    listItem.setProgress(progress);
    listItem.setProgress(progress);
    listItem.setOnSeekBarChangeListener(
    listItem.setOnSeekBarChangeListener(
        new CarVolumeDialogImpl.VolumeSeekBarChangeListener(volumeGroupId, mCarAudioManager));
        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) {
    if (supplementalIconId != 0) {
      Drawable supplementalIcon = mContext.getResources().getDrawable(supplementalIconId);
      Drawable supplementalIcon = mContext.getResources().getDrawable(supplementalIconId);
      supplementalIcon.setTint(color);
      listItem.setSupplementalIcon(supplementalIcon, true,
      listItem.setSupplementalIcon(supplementalIcon, true,
          supplementalIconOnClickListener);
          supplementalIconOnClickListener);
    } else {
    } else {