[WifiSettings] Add progress bar when scanning

Add a progress bar when the Wi-Fi screen is in a transient state,
like enabling, disabling Wi-Fi and scanning for network. This change
sets the progress bar as a pinned header at the top of the activity.

The pinned header container needs to be match parent so that the
progress bar can occupy the full width of the screen. If the header
view doesn't want to fill the width, then the header view *inside*
the container should be wrap_content.

Added an overloaded setPinnedHeader method that takes a layout
resource ID, and returns the view to the caller. This way the
inflater can set the parent property so that layout params will not
be ignored.

Bug: 17389577
Change-Id: I18d0eb7c72ad31d1c4b35a54789016c32c81fb93
This commit is contained in:
Maurice Lam
2015-04-21 23:01:11 -07:00
parent bc95630994
commit 28c3f6bb71
10 changed files with 145 additions and 9 deletions

View File

@@ -148,6 +148,17 @@ public class WifiSettingsForSetupWizard extends WifiSettings {
}
}
@Override
public View setPinnedHeaderView(int layoutResId) {
// Pinned header is not supported in setup wizard
return null;
}
@Override
public void setPinnedHeaderView(View pinnedHeader) {
// Pinned header is not supported in setup wizard
}
@Override
protected void setProgressBarVisible(boolean visible) {
if (mLayout != null) {