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
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user