Merge "Show colorAccent icon color for connected Wi-Fi entry" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e08ddd5fe2
@@ -186,6 +186,10 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
|
|||||||
// TODO(b/70983952): Fill this method in
|
// TODO(b/70983952): Fill this method in
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int getIconColorAttr() {
|
||||||
|
return (mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTED)
|
||||||
|
? android.R.attr.colorAccent : android.R.attr.colorControlNormal;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateIcon(boolean showX, int level) {
|
private void updateIcon(boolean showX, int level) {
|
||||||
if (level == -1) {
|
if (level == -1) {
|
||||||
@@ -195,8 +199,7 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
|
|||||||
|
|
||||||
final Drawable drawable = mIconInjector.getIcon(showX, level);
|
final Drawable drawable = mIconInjector.getIcon(showX, level);
|
||||||
if (drawable != null) {
|
if (drawable != null) {
|
||||||
drawable.setTintList(Utils.getColorAttr(getContext(),
|
drawable.setTint(Utils.getColorAttrDefaultColor(getContext(), getIconColorAttr()));
|
||||||
android.R.attr.colorControlNormal));
|
|
||||||
setIcon(drawable);
|
setIcon(drawable);
|
||||||
} else {
|
} else {
|
||||||
setIcon(null);
|
setIcon(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user