Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa4a5662 authored by Randall Rushing's avatar Randall Rushing Committed by d34d
Browse files

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: default avatarBryan Owens <djbryan3540@gmail.com>

Change-Id: I862008d1b433666333a4c77904b44a05e70472a2
parent b5dd0799
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>
+4 −1
Original line number Diff line number Diff line
@@ -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