diff options
author | John Spurlock <jspurlock@google.com> | 2015-05-11 12:12:07 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-05-11 12:12:07 -0400 |
commit | 77bb25af3dbf34b6c88549ae931b069a788316fc (patch) | |
tree | 4579bf85a2a9d1180fd8d3604d150e82ebf51b0f /packages/SystemUI | |
parent | e71442521a4bee759b807c917811da3a9d4b1d73 (diff) | |
download | frameworks_base-77bb25af3dbf34b6c88549ae931b069a788316fc.zip frameworks_base-77bb25af3dbf34b6c88549ae931b069a788316fc.tar.gz frameworks_base-77bb25af3dbf34b6c88549ae931b069a788316fc.tar.bz2 |
Volume: Separate tint colors for active vs inactive sliders.
Bug: 20889746
Change-Id: I98f6a0eab8f2db41ea7e1ba8e141752ef774de9e
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/res/layout/volume_dialog_row.xml | 4 | ||||
-rw-r--r-- | packages/SystemUI/res/values/colors.xml | 1 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java | 11 |
3 files changed, 13 insertions, 3 deletions
diff --git a/packages/SystemUI/res/layout/volume_dialog_row.xml b/packages/SystemUI/res/layout/volume_dialog_row.xml index 53ae61b..d12bf5d 100644 --- a/packages/SystemUI/res/layout/volume_dialog_row.xml +++ b/packages/SystemUI/res/layout/volume_dialog_row.xml @@ -50,9 +50,7 @@ android:layout_toEndOf="@id/volume_row_icon" android:layout_toStartOf="@+id/volume_settings_button" android:paddingEnd="8dp" - android:paddingStart="8dp" - android:progressTint="@android:color/white" - android:thumbTint="@android:color/white" /> + android:paddingStart="8dp" /> <com.android.keyguard.AlphaOptimizedImageButton android:id="@+id/volume_settings_button" diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index b47d81d..0dcbe88 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -142,4 +142,5 @@ <color name="zen_introduction_message_background">#ff009688</color><!-- deep teal 500 --> <color name="volume_icon_color">#ffffffff</color> <color name="volume_settings_icon_color">#7fffffff</color> + <color name="volume_slider_inactive">#FFB0BEC5</color><!-- blue grey 200 --> </resources> 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); } } |