Merge "Fix colors for a11y" into sc-dev
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
android:right="@dimen/rounded_slider_icon_inset">
|
android:right="@dimen/rounded_slider_icon_inset">
|
||||||
<com.android.systemui.util.AlphaTintDrawableWrapper
|
<com.android.systemui.util.AlphaTintDrawableWrapper
|
||||||
android:drawable="@drawable/ic_brightness"
|
android:drawable="@drawable/ic_brightness"
|
||||||
android:tint="?android:attr/colorBackground"
|
android:tint="?android:attr/textColorPrimaryInverse"
|
||||||
android:alpha="0.8"/>
|
/>
|
||||||
</item>
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<stroke android:width="1dp" android:color="@color/qs_footer_action_border"/>
|
<stroke android:width="1dp" android:color="?android:attr/colorBackground"/>
|
||||||
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:padding="@dimen/qs_footer_icon_padding"
|
android:padding="@dimen/qs_footer_icon_padding"
|
||||||
android:src="@*android:drawable/ic_mode_edit"
|
android:src="@*android:drawable/ic_mode_edit"
|
||||||
android:tint="?android:attr/colorForeground" />
|
android:tint="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||||
android:id="@+id/multi_user_switch"
|
android:id="@+id/multi_user_switch"
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
android:padding="@dimen/qs_footer_icon_padding"
|
android:padding="@dimen/qs_footer_icon_padding"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/ic_settings"
|
android:src="@drawable/ic_settings"
|
||||||
android:tint="?android:attr/colorForeground" />
|
android:tint="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||||
android:id="@+id/tuner_icon"
|
android:id="@+id/tuner_icon"
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
android:padding="@dimen/qs_footer_icon_padding"
|
android:padding="@dimen/qs_footer_icon_padding"
|
||||||
android:src="@*android:drawable/ic_lock_power_off"
|
android:src="@*android:drawable/ic_lock_power_off"
|
||||||
android:contentDescription="@string/accessibility_quick_settings_power_menu"
|
android:contentDescription="@string/accessibility_quick_settings_power_menu"
|
||||||
android:tint="?android:attr/colorForeground" />
|
android:tint="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
<color name="status_bar_clock_color">#FFFFFFFF</color>
|
<color name="status_bar_clock_color">#FFFFFFFF</color>
|
||||||
<color name="qs_user_detail_icon_muted">#FFFFFFFF</color> <!-- not so muted after all -->
|
<color name="qs_user_detail_icon_muted">#FFFFFFFF</color> <!-- not so muted after all -->
|
||||||
<color name="qs_tile_disabled_color">#9E9E9E</color> <!-- 38% black -->
|
<color name="qs_tile_disabled_color">#9E9E9E</color> <!-- 38% black -->
|
||||||
<color name="qs_footer_action_border">#2E312C</color>
|
|
||||||
|
|
||||||
<!-- The color of the background in the separated list of the Global Actions menu -->
|
<!-- The color of the background in the separated list of the Global Actions menu -->
|
||||||
<color name="global_actions_separated_background">#F5F5F5</color>
|
<color name="global_actions_separated_background">#F5F5F5</color>
|
||||||
|
|||||||
@@ -235,7 +235,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.QS.Status.NoCarrierText">
|
<style name="TextAppearance.QS.Status.NoCarrierText">
|
||||||
<item name="android:textColor">?android:attr/textColorTertiary</item>
|
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.QS.Build">
|
<style name="TextAppearance.QS.Build">
|
||||||
|
|||||||
@@ -244,11 +244,13 @@ public class QSIconViewImpl extends QSIconView {
|
|||||||
public static int getIconColorForState(Context context, int state) {
|
public static int getIconColorForState(Context context, int state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case Tile.STATE_UNAVAILABLE:
|
case Tile.STATE_UNAVAILABLE:
|
||||||
return Utils.getColorAttrDefaultColor(context, android.R.attr.textColorTertiary);
|
return Utils.applyAlpha(QSTileViewImpl.UNAVAILABLE_ALPHA,
|
||||||
|
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary));
|
||||||
case Tile.STATE_INACTIVE:
|
case Tile.STATE_INACTIVE:
|
||||||
return Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary);
|
return Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary);
|
||||||
case Tile.STATE_ACTIVE:
|
case Tile.STATE_ACTIVE:
|
||||||
return Utils.getColorAttrDefaultColor(context, android.R.attr.colorPrimary);
|
return Utils.getColorAttrDefaultColor(context,
|
||||||
|
android.R.attr.textColorPrimaryInverse);
|
||||||
default:
|
default:
|
||||||
Log.e("QSIconView", "Invalid state " + state);
|
Log.e("QSIconView", "Invalid state " + state);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
private const val LABEL_NAME = "label"
|
private const val LABEL_NAME = "label"
|
||||||
private const val SECONDARY_LABEL_NAME = "secondaryLabel"
|
private const val SECONDARY_LABEL_NAME = "secondaryLabel"
|
||||||
private const val CHEVRON_NAME = "chevron"
|
private const val CHEVRON_NAME = "chevron"
|
||||||
|
const val UNAVAILABLE_ALPHA = 0.3f
|
||||||
}
|
}
|
||||||
|
|
||||||
override var heightOverride: Int = HeightOverrideable.NO_OVERRIDE
|
override var heightOverride: Int = HeightOverrideable.NO_OVERRIDE
|
||||||
@@ -68,15 +69,20 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
private val colorActive = Utils.getColorAttrDefaultColor(context,
|
private val colorActive = Utils.getColorAttrDefaultColor(context,
|
||||||
com.android.internal.R.attr.colorAccentPrimary)
|
com.android.internal.R.attr.colorAccentPrimary)
|
||||||
private val colorInactive = Utils.getColorAttrDefaultColor(context, R.attr.offStateColor)
|
private val colorInactive = Utils.getColorAttrDefaultColor(context, R.attr.offStateColor)
|
||||||
private val colorUnavailable =
|
private val colorUnavailable = Utils.applyAlpha(UNAVAILABLE_ALPHA, colorInactive)
|
||||||
Utils.getColorAttrDefaultColor(context, android.R.attr.colorBackground)
|
|
||||||
|
|
||||||
private val colorLabelActive =
|
private val colorLabelActive =
|
||||||
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse)
|
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse)
|
||||||
private val colorLabelInactive =
|
private val colorLabelInactive =
|
||||||
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary)
|
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary)
|
||||||
private val colorLabelUnavailable =
|
private val colorLabelUnavailable = Utils.applyAlpha(UNAVAILABLE_ALPHA, colorLabelInactive)
|
||||||
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorTertiary)
|
|
||||||
|
private val colorSecondaryLabelActive =
|
||||||
|
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondaryInverse)
|
||||||
|
private val colorSecondaryLabelInactive =
|
||||||
|
Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondary)
|
||||||
|
private val colorSecondaryLabelUnavailable =
|
||||||
|
Utils.applyAlpha(UNAVAILABLE_ALPHA, colorSecondaryLabelInactive)
|
||||||
|
|
||||||
private lateinit var label: TextView
|
private lateinit var label: TextView
|
||||||
protected lateinit var secondaryLabel: TextView
|
protected lateinit var secondaryLabel: TextView
|
||||||
@@ -404,7 +410,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
),
|
),
|
||||||
colorValuesHolder(
|
colorValuesHolder(
|
||||||
SECONDARY_LABEL_NAME,
|
SECONDARY_LABEL_NAME,
|
||||||
label.currentTextColor,
|
secondaryLabel.currentTextColor,
|
||||||
getSecondaryLabelColorForState(state.state)
|
getSecondaryLabelColorForState(state.state)
|
||||||
),
|
),
|
||||||
colorValuesHolder(
|
colorValuesHolder(
|
||||||
@@ -418,7 +424,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
setAllColors(
|
setAllColors(
|
||||||
getBackgroundColorForState(state.state),
|
getBackgroundColorForState(state.state),
|
||||||
getLabelColorForState(state.state),
|
getLabelColorForState(state.state),
|
||||||
getLabelColorForState(state.state),
|
getSecondaryLabelColorForState(state.state),
|
||||||
getChevronColorForState(state.state)
|
getChevronColorForState(state.state)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -533,8 +539,9 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
|
|
||||||
private fun getSecondaryLabelColorForState(state: Int): Int {
|
private fun getSecondaryLabelColorForState(state: Int): Int {
|
||||||
return when (state) {
|
return when (state) {
|
||||||
Tile.STATE_ACTIVE -> colorLabelActive
|
Tile.STATE_ACTIVE -> colorSecondaryLabelActive
|
||||||
Tile.STATE_INACTIVE, Tile.STATE_UNAVAILABLE -> colorLabelUnavailable
|
Tile.STATE_INACTIVE -> colorSecondaryLabelInactive
|
||||||
|
Tile.STATE_UNAVAILABLE -> colorSecondaryLabelUnavailable
|
||||||
else -> {
|
else -> {
|
||||||
Log.e(TAG, "Invalid state $state")
|
Log.e(TAG, "Invalid state $state")
|
||||||
0
|
0
|
||||||
|
|||||||
Reference in New Issue
Block a user