Fix Wifi-Detail page colors

There were some hardcoded colors in this page that should have
been using colorControlNormal. This CL just updates it to use those.

Test: Visual inspection
Fixes: 37628554
Change-Id: I431744e7613eeb0ac751cf1505bcf2ef9e19d95d
This commit is contained in:
Salvador Martinez
2018-11-27 15:20:15 -08:00
parent 662b209b15
commit 807d3d98ec
5 changed files with 24 additions and 45 deletions

View File

@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<issues format="4"> <issues format="4">
<issue
id="LintError"
severity="Error"
message="No `.class` files were found in project &quot;.&quot;, so none of the classfile based checks could be run. Does the project need to be built first?"
category="Lint"
priority="10"
summary="Lint Failure"
explanation="This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc.&#xA;These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed.">
<location
file="."/>
</issue>
<issue <issue
id="HardCodedColor" id="HardCodedColor"
severity="Error" severity="Error"
@@ -985,8 +997,8 @@
priority="4" priority="4"
summary="Using hardcoded color" summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app." explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" &lt;color name=&quot;wifi_details_icon_color&quot;>#8A000000&lt;/color>" errorLine1=" &lt;color name=&quot;fallback_tintColor&quot;>#89000000&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location <location
file="res/values/colors.xml" file="res/values/colors.xml"
line="103" line="103"
@@ -1761,22 +1773,6 @@
column="23"/> column="23"/>
</issue> </issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:tint=&quot;@color/wifi_details_icon_color&quot;>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_frequency_antenna.xml"
line="22"
column="9"/>
</issue>
<issue <issue
id="HardCodedColor" id="HardCodedColor"
severity="Error" severity="Error"
@@ -2097,22 +2093,6 @@
column="5"/> column="5"/>
</issue> </issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:tint=&quot;@color/wifi_details_icon_color&quot;>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_security_lock_24dp.xml"
line="22"
column="9"/>
</issue>
<issue <issue
id="HardCodedColor" id="HardCodedColor"
severity="Error" severity="Error"
@@ -2669,7 +2649,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~"> errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location <location
file="res/values/strings.xml" file="res/values/strings.xml"
line="5907" line="5805"
column="36"/> column="36"/>
</issue> </issue>
@@ -2701,7 +2681,7 @@
errorLine2=" ^"> errorLine2=" ^">
<location <location
file="res/values/styles.xml" file="res/values/styles.xml"
line="427" line="422"
column="44"/> column="44"/>
</issue> </issue>
@@ -2717,7 +2697,7 @@
errorLine2=" ^"> errorLine2=" ^">
<location <location
file="res/values/styles.xml" file="res/values/styles.xml"
line="433" line="428"
column="44"/> column="44"/>
</issue> </issue>
@@ -2733,7 +2713,7 @@
errorLine2=" ^"> errorLine2=" ^">
<location <location
file="res/values/styles.xml" file="res/values/styles.xml"
line="434" line="429"
column="44"/> column="44"/>
</issue> </issue>
@@ -2749,7 +2729,7 @@
errorLine2=" ^"> errorLine2=" ^">
<location <location
file="res/values/styles.xml" file="res/values/styles.xml"
line="461" line="464"
column="34"/> column="34"/>
</issue> </issue>

View File

@@ -19,7 +19,7 @@
android:viewportHeight="24" android:viewportHeight="24"
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:tint="@color/wifi_details_icon_color"> android:tint="?android:attr/colorControlNormal">
<path <path
android:pathData="M12,5c-3.9,0-7,3.1-7,7h2c0-2.8,2.2-5,5-5s5,2.2,5,5h2C19,8.1,15.9,5,12,5z M13,14.3c0.9-0.4,1.5-1.3,1.5-2.3 android:pathData="M12,5c-3.9,0-7,3.1-7,7h2c0-2.8,2.2-5,5-5s5,2.2,5,5h2C19,8.1,15.9,5,12,5z M13,14.3c0.9-0.4,1.5-1.3,1.5-2.3
c0-1.4-1.1-2.5-2.5-2.5S9.5,10.6,9.5,12c0,1,0.6,1.9,1.5,2.3v3.3L7.6,21L9,22.4l3-3l3,3l1.4-1.4L13,17.6V14.3z M12,1 c0-1.4-1.1-2.5-2.5-2.5S9.5,10.6,9.5,12c0,1,0.6,1.9,1.5,2.3v3.3L7.6,21L9,22.4l3-3l3,3l1.4-1.4L13,17.6V14.3z M12,1

View File

@@ -19,7 +19,7 @@
android:viewportHeight="24" android:viewportHeight="24"
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:tint="@color/wifi_details_icon_color"> android:tint="?android:attr/colorControlNormal">
<path <path
android:pathData="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z" android:pathData="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"
android:fillColor="#FFFFFFFF" /> android:fillColor="#FFFFFFFF" />

View File

@@ -99,8 +99,8 @@
<!-- Color for the background of the shortcut icons.--> <!-- Color for the background of the shortcut icons.-->
<color name="shortcut_background">#fff5f5f5</color> <color name="shortcut_background">#fff5f5f5</color>
<!-- Color for preference icons on the Wifi Network Details page --> <!-- The fallback color for tinting icons. Only used when colorControlNormal is unavailable -->
<color name="wifi_details_icon_color">#8A000000</color> <color name="fallback_tintColor">#89000000</color>
<!-- Suggestion/condition colors --> <!-- Suggestion/condition colors -->
<color name="suggestion_condition_background">#f2f2f2</color> <color name="suggestion_condition_background">#f2f2f2</color>

View File

@@ -408,8 +408,7 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
mEntityHeaderController.setIcon(wifiIcon).done(mFragment.getActivity(), true /* rebind */); mEntityHeaderController.setIcon(wifiIcon).done(mFragment.getActivity(), true /* rebind */);
Drawable wifiIconDark = wifiIcon.getConstantState().newDrawable().mutate(); Drawable wifiIconDark = wifiIcon.getConstantState().newDrawable().mutate();
wifiIconDark.setTint(mContext.getResources().getColor( wifiIconDark.setTintList(Utils.getColorAttr(mContext, android.R.attr.colorControlNormal));
R.color.wifi_details_icon_color, mContext.getTheme()));
mSignalStrengthPref.setIcon(wifiIconDark); mSignalStrengthPref.setIcon(wifiIconDark);
mSignalStrengthPref.setSummary(mSignalStr[mRssiSignalLevel]); mSignalStrengthPref.setSummary(mSignalStr[mRssiSignalLevel]);