diff options
| author | John Spurlock <jspurlock@google.com> | 2015-05-11 16:15:21 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-11 16:15:22 +0000 |
| commit | 13ea79dea443831c1936f9ac47109144705149f6 (patch) | |
| tree | a31b8f4231859db1fad08a613febb989380458aa /packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java | |
| parent | 7846d966f5b0d78fa819b56d45be3b668f34dcfb (diff) | |
| parent | 77bb25af3dbf34b6c88549ae931b069a788316fc (diff) | |
| download | frameworks_base-13ea79dea443831c1936f9ac47109144705149f6.zip frameworks_base-13ea79dea443831c1936f9ac47109144705149f6.tar.gz frameworks_base-13ea79dea443831c1936f9ac47109144705149f6.tar.bz2 | |
Merge "Volume: Separate tint colors for active vs inactive sliders." into mnc-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java')
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java | 11 |
1 files changed, 11 insertions, 0 deletions
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.annotation.SuppressLint; 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 @@ public class VolumeDialog { 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 @@ public class VolumeDialog { 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 @@ public class VolumeDialog { 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 @@ public class VolumeDialog { } 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); } } |
