Show greyed out icon when Wi-Fi network is restricted to configurate
- Use Drawable#setTintList() instead of Drawable#setTint() to show greyed out icon when the preference is disabled. Bug: 233175849 Test: manual test make RunSettingsRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest Change-Id: I451106530bc19bc733fd58a57e8ac336b023e65e
This commit is contained in:
@@ -17,6 +17,8 @@ package com.android.settings.wifi;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -252,4 +254,14 @@ public class WifiEntryPreferenceTest {
|
||||
|
||||
assertThat(view.findViewById(R.id.icon_button).getVisibility()).isEqualTo(View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateIcon_ShouldSetTintListForDrawable() {
|
||||
WifiEntryPreference pref =
|
||||
new WifiEntryPreference(mContext, mMockWifiEntry, mMockIconInjector);
|
||||
|
||||
pref.updateIcon(false /* showX */, 4 /* level */);
|
||||
|
||||
verify(mMockDrawable4).setTintList(any());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user