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

Commit b1af5d91 authored by Galia Peycheva's avatar Galia Peycheva
Browse files

Remove change of tint on volume dialog hide on TV

On TV we don't want the volume dialog to change tint when it is being
dismissed. So we introduce a new config value for this.

Bug: 167732325
Test: m && flash && verify that tinting is no longer there
Change-Id: I127f0891951662f8db31adc863cd5e05f000d685
parent 5b91ff15
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -45,4 +45,7 @@

    <!-- Show a separate icon for low and high volume on the volume dialog -->
    <bool name="config_showLowMediaVolumeIcon">true</bool>

    <!-- Change the volume row tint when it is inactive, i.e. when it is being dismissed -->
    <bool name="config_changeVolumeRowTintWhenInactive">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -562,4 +562,7 @@

    <!-- Show a separate icon for low and high volume on the volume dialog -->
    <bool name="config_showLowMediaVolumeIcon">false</bool>

    <!-- Change the volume row tint when it is inactive, i.e. when it is being dismissed -->
    <bool name="config_changeVolumeRowTintWhenInactive">true</bool>
</resources>
+6 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ public class VolumeDialogImpl implements VolumeDialog,
    private boolean mShowA11yStream;

    private final boolean mShowLowMediaVolumeIcon;
    private final boolean mChangeVolumeRowTintWhenInactive;

    private int mActiveStream;
    private int mPrevActiveStream;
@@ -183,6 +184,8 @@ public class VolumeDialogImpl implements VolumeDialog,
                Prefs.getBoolean(context, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, false);
        mShowLowMediaVolumeIcon =
            mContext.getResources().getBoolean(R.bool.config_showLowMediaVolumeIcon);
        mChangeVolumeRowTintWhenInactive =
            mContext.getResources().getBoolean(R.bool.config_changeVolumeRowTintWhenInactive);
    }

    @Override
@@ -1154,6 +1157,9 @@ public class VolumeDialogImpl implements VolumeDialog,
            row.slider.requestFocus();
        }
        boolean useActiveColoring = isActive && row.slider.isEnabled();
        if (!useActiveColoring && !mChangeVolumeRowTintWhenInactive) {
            return;
        }
        final ColorStateList tint = useActiveColoring
                ? Utils.getColorAccent(mContext)
                : Utils.getColorAttr(mContext, android.R.attr.colorForeground);