[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

@@ -22,7 +22,6 @@ import android.content.Intent;
import android.content.pm.UserInfo;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@@ -59,9 +58,7 @@ public class RestrictedProfileSettings extends AppRestrictionsFragment
@Override
public void onActivityCreated(Bundle savedInstanceState) {
if (mHeaderView == null) {
mHeaderView = LayoutInflater.from(getActivity()).inflate(
R.layout.user_info_header, null);
setPinnedHeaderView(mHeaderView);
mHeaderView = setPinnedHeaderView(R.layout.user_info_header);
mHeaderView.setOnClickListener(this);
mUserIconView = (ImageView) mHeaderView.findViewById(android.R.id.icon);
mUserNameView = (TextView) mHeaderView.findViewById(android.R.id.title);