[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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user