Volume: Separate tint colors for active vs inactive sliders.
Bug: 20889746
Change-Id: I98f6a0eab8f2db41ea7e1ba8e141752ef774de9e
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
index 1e34663..4bc45df 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
@@ -26,6 +26,7 @@
import android.app.Dialog;
import android.app.KeyguardManager;
import android.content.Context;
+import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PixelFormat;
@@ -107,6 +108,8 @@
private final LayoutTransition mLayoutTransition;
private final Object mSafetyWarningLock = new Object();
private final Accessibility mAccessibility = new Accessibility();
+ private final ColorStateList mActiveSliderTint;
+ private final ColorStateList mInactiveSliderTint;
private boolean mShowing;
private boolean mExpanded;
@@ -152,6 +155,8 @@
lp.gravity = Gravity.TOP;
window.setAttributes(lp);
+ mActiveSliderTint = loadColorStateList(R.color.system_accent_color);
+ mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive);
mDialog.setContentView(R.layout.volume_dialog);
mDialogView = (ViewGroup) mDialog.findViewById(R.id.volume_dialog);
mDialogContentView = (ViewGroup) mDialog.findViewById(R.id.volume_dialog_content);
@@ -190,6 +195,10 @@
controller.getState();
}
+ private ColorStateList loadColorStateList(int colorResId) {
+ return ColorStateList.valueOf(mContext.getColor(colorResId));
+ }
+
private void updateWindowWidthH() {
final ViewGroup.LayoutParams lp = mDialogView.getLayoutParams();
final DisplayMetrics dm = mContext.getResources().getDisplayMetrics();
@@ -524,6 +533,8 @@
}
Util.setVisOrInvis(row.settingsButton, false);
row.header.setAlpha(mExpanded && isActive ? 1 : 0.5f);
+ row.slider.setProgressTintList(isActive ? mActiveSliderTint : mInactiveSliderTint);
+ row.slider.setThumbTintList(isActive ? mActiveSliderTint : mInactiveSliderTint);
}
}