OSDN Git Service

Apply tint to the Volume Dialog primary and supplement icon
authorLin Guo <linguo@google.com>
Fri, 25 May 2018 00:31:50 +0000 (17:31 -0700)
committerLin Guo <linguo@google.com>
Fri, 25 May 2018 00:31:50 +0000 (17:31 -0700)
BUG: 79437820
Test: manual
Change-Id: I7bbb70e83ea4825977f9108f207327cc7b0e3a22

packages/SystemUI/res/values/colors_car.xml
packages/SystemUI/src/com/android/systemui/volume/CarVolumeDialogImpl.java

index cb3abb9..49bfb25 100644 (file)
@@ -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>
index 8034345..bf962b8 100644 (file)
@@ -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 {