Merge "Show greyed out icon when Wi-Fi network is restricted to configurate" into tm-qpr-dev am: 74a748ece8

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19967514

Change-Id: I5646b7ff9e291b70295cbbb180f3e0513f51866f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-09-19 04:23:30 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 2 deletions

View File

@@ -201,7 +201,8 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
return accent ? android.R.attr.colorAccent : android.R.attr.colorControlNormal;
}
private void updateIcon(boolean showX, int level) {
@VisibleForTesting
void updateIcon(boolean showX, int level) {
if (level == -1) {
setIcon(null);
return;
@@ -209,7 +210,9 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
final Drawable drawable = mIconInjector.getIcon(showX, level);
if (drawable != null) {
drawable.setTint(Utils.getColorAttrDefaultColor(getContext(), getIconColorAttr()));
// Must use Drawable#setTintList() instead of Drawable#setTint() to show the grey
// icon when the preference is disabled.
drawable.setTintList(Utils.getColorAttr(getContext(), getIconColorAttr()));
setIcon(drawable);
} else {
setIcon(null);