Improve Wi-Fi Settings UI in guest mode
Progress bar is still seen along with a permission forbidden tip in guest mode and it's confusing. It should be hidden because actually nothing happens there. When Wi-Fi is off, Wi-Fi OFF tip should be shown even in guest mode becuase it should be consistent with Wi-Fi status. Improves d8c3ca43163427a75c8b70114096238177f97af0. Bug:31235488 Test: manual inspection. Change-Id: I611719db253a0aec03d61e881af0e5dc3869d50b Merged-In: If89728e293721cea45dcd717316d87f6df17ea7c
This commit is contained in:
@@ -168,6 +168,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
|
mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
|
||||||
|
setProgressBarVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,14 +603,19 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
public void onAccessPointsChanged() {
|
public void onAccessPointsChanged() {
|
||||||
// Safeguard from some delayed event handling
|
// Safeguard from some delayed event handling
|
||||||
if (getActivity() == null) return;
|
if (getActivity() == null) return;
|
||||||
|
final int wifiState = mWifiManager.getWifiState();
|
||||||
if (isUiRestricted()) {
|
if (isUiRestricted()) {
|
||||||
if (!isUiRestrictedByOnlyAdmin()) {
|
if (!isUiRestrictedByOnlyAdmin()) {
|
||||||
addMessagePreference(R.string.wifi_empty_list_user_restricted);
|
if (WifiManager.WIFI_STATE_DISABLED == wifiState) {
|
||||||
|
addMessagePreference(R.string.wifi_empty_list_wifi_off);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addMessagePreference(R.string.wifi_empty_list_user_restricted);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getPreferenceScreen().removeAll();
|
getPreferenceScreen().removeAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int wifiState = mWifiManager.getWifiState();
|
|
||||||
|
|
||||||
switch (wifiState) {
|
switch (wifiState) {
|
||||||
case WifiManager.WIFI_STATE_ENABLED:
|
case WifiManager.WIFI_STATE_ENABLED:
|
||||||
@@ -702,7 +708,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
private void setOffMessage() {
|
private void setOffMessage() {
|
||||||
if (isUiRestricted()) {
|
if (isUiRestricted()) {
|
||||||
if (!isUiRestrictedByOnlyAdmin()) {
|
if (!isUiRestrictedByOnlyAdmin()) {
|
||||||
addMessagePreference(R.string.wifi_empty_list_user_restricted);
|
addMessagePreference(R.string.wifi_empty_list_wifi_off);
|
||||||
}
|
}
|
||||||
getPreferenceScreen().removeAll();
|
getPreferenceScreen().removeAll();
|
||||||
return;
|
return;
|
||||||
@@ -758,7 +764,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
protected void setProgressBarVisible(boolean visible) {
|
protected void setProgressBarVisible(boolean visible) {
|
||||||
if (mProgressHeader != null) {
|
if (mProgressHeader != null) {
|
||||||
mProgressHeader.setVisibility(visible ? View.VISIBLE : View.GONE);
|
mProgressHeader.setVisibility(visible && !isUiRestricted() ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user