[WifiSetup] Progress when wifi scanning

Use a custom empty view to show the status while wifi is scanning
or off. Cannot use android.R.id.empty because in phone portrait
layout the illustration is the listview header, which will be hidden
if the list is empty and we use ListView.setEmptyView.

Bug: 17183006
Change-Id: Ie8598303f4e61f87e078008fb7a03918ba92c9ef
This commit is contained in:
Maurice Lam
2014-08-24 18:29:40 -07:00
parent aa5c7565e4
commit b6c414a6d2
2 changed files with 54 additions and 8 deletions

View File

@@ -321,8 +321,7 @@ public class WifiSettings extends RestrictedSettingsFragment
prepareWifiAssistantCard();
mEmptyView = (TextView) getView().findViewById(android.R.id.empty);
getListView().setEmptyView(mEmptyView);
mEmptyView = initEmptyView();
registerForContextMenu(getListView());
setHasOptionsMenu(true);
}
@@ -773,6 +772,12 @@ public class WifiSettings extends RestrictedSettingsFragment
editor.apply();
}
protected TextView initEmptyView() {
TextView emptyView = (TextView) getActivity().findViewById(android.R.id.empty);
getListView().setEmptyView(emptyView);
return emptyView;
}
private void setOffMessage() {
if (mEmptyView != null) {
mEmptyView.setCompoundDrawablesWithIntrinsicBounds(0,