diff options
author | Randall Rushing <randall.rushing@gmail.com> | 2016-01-12 10:16:01 -0600 |
---|---|---|
committer | d34d <clark@cyngn.com> | 2016-01-18 12:45:18 -0800 |
commit | aa4a5662f7c4ea93bc5346415fc2e139acade573 (patch) | |
tree | ec336177ce0e490686d75d1aebe6d78a19f746c7 /packages/SystemUI | |
parent | b5dd079914e35128d775ff64fbaba40ee74f209a (diff) | |
download | frameworks_base-aa4a5662f7c4ea93bc5346415fc2e139acade573.zip frameworks_base-aa4a5662f7c4ea93bc5346415fc2e139acade573.tar.gz frameworks_base-aa4a5662f7c4ea93bc5346415fc2e139acade573.tar.bz2 |
Themes: Expose volume slider and thumb colors and make them work with custom images.
Credit Bryan Owens for giving guidance on what was needed.
Signed-off-by: Bryan Owens <djbryan3540@gmail.com>
Change-Id: I862008d1b433666333a4c77904b44a05e70472a2
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/res/values/cm_colors.xml | 3 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/SystemUI/res/values/cm_colors.xml b/packages/SystemUI/res/values/cm_colors.xml index ec1da61..85b3d58 100644 --- a/packages/SystemUI/res/values/cm_colors.xml +++ b/packages/SystemUI/res/values/cm_colors.xml @@ -113,4 +113,7 @@ <!-- Quick tile text color when the tile is disabled --> <color name="qs_tile_text_disabled">#ff747474</color> + + <!-- Active color for volume slider --> + <color name="volume_slider_active">@color/system_accent_color</color> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java index 003662b..aa2f0d3 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java @@ -31,6 +31,7 @@ import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Color; import android.graphics.PixelFormat; +import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.ColorDrawable; @@ -164,7 +165,7 @@ public class VolumeDialog { window.setAttributes(lp); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING); - mActiveSliderTint = loadColorStateList(R.color.system_accent_color); + mActiveSliderTint = loadColorStateList(R.color.volume_slider_active); mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive); mDialog.setContentView(R.layout.volume_dialog); mDialogView = (ViewGroup) mDialog.findViewById(R.id.volume_dialog); @@ -363,6 +364,8 @@ public class VolumeDialog { row.header = (TextView) row.view.findViewById(R.id.volume_row_header); mSpTexts.add(row.header); row.slider = (SeekBar) row.view.findViewById(R.id.volume_row_slider); + row.slider.setProgressTintMode(PorterDuff.Mode.SRC_ATOP); + row.slider.setThumbTintMode(PorterDuff.Mode.SRC_ATOP); row.slider.setOnSeekBarChangeListener(new VolumeSeekBarChangeListener(row)); // forward events above the slider into the slider |