Fix wifi flow

- show progress bar correctly
- stop inappropriately showing padding views
- expand the screen when successful.

Bug: 3378348
Bug: 3378341
Change-Id: I89ff31d24c050755c90fbf07cd4f56d8f0ddeac9
This commit is contained in:
Daisuke Miyakawa
2011-01-21 14:29:50 -08:00
parent 5dc460e407
commit 350b724d09

View File

@@ -258,6 +258,7 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
}
case CONNECTED: {
hideSoftwareKeyboard();
setPaddingVisibility(View.VISIBLE);
// If the device is already connected to a wifi without users' "Connect" request,
// this can be false here. We want to treat it as "after connect action".
@@ -302,8 +303,13 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
showConnectingTitle();
mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(1);
// We may enter "Connecting" status during editing password again (if the Wifi module
// tries to (re)connect a network.)
if (mAfterConnectAction) {
setPaddingVisibility(View.VISIBLE);
}
}
private void showDefaultTitle() {
mTitleView.setText(getString(R.string.wifi_setup_title));
@@ -535,6 +541,14 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
*/
/* package */ void onAccessPointsUpdated(
PreferenceCategory holder, Collection<AccessPoint> accessPoints) {
// If we already show some of access points but the bar still shows "scanning" state, it
// should be stopped.
if (mProgressBar.isIndeterminate() && accessPoints.size() > 0) {
mProgressBar.setIndeterminate(false);
mAddNetworkButton.setEnabled(true);
mRefreshButton.setEnabled(true);
}
for (AccessPoint accessPoint : accessPoints) {
accessPoint.setLayoutResource(R.layout.custom_preference);
holder.addPreference(accessPoint);