Clean up XL Wifi setup and fix misc problems.

- Introduce screen state, which suppress inconsistent
  UI shown in 3378805.
- Introduce initSecurityFields(), which will reduce hook
  inside WifiConfigController#showSecurityfields()
- fix layout for eap-not-supported case with "add network"
  flow.

Bug: 3378805
Bug: 3403168
Change-Id: I52895570809095d9baceac5f84665572188ecefd
This commit is contained in:
Daisuke Miyakawa
2011-02-04 10:36:46 -08:00
parent b5f3addfc5
commit 35eae7ccc7
5 changed files with 152 additions and 100 deletions

View File

@@ -159,7 +159,7 @@ public class WifiConfigController implements TextWatcher,
mSsidView.addTextChangedListener(this);
mSecuritySpinner = ((Spinner) mView.findViewById(R.id.security));
mSecuritySpinner.setOnItemSelectedListener(this);
if (context instanceof WifiSettingsForSetupWizardXL) {
if (mInXlSetupWizard) {
// We want custom layout. The content must be same as the other cases.
mSecuritySpinner.setAdapter(
new ArrayAdapter<String>(context, R.layout.wifi_setup_custom_list_item_1,
@@ -485,16 +485,16 @@ public class WifiConfigController implements TextWatcher,
}
private void showSecurityFields() {
if (mInXlSetupWizard) {
// Note: XL SetupWizard won't hide "EAP" settings here.
if (!((WifiSettingsForSetupWizardXL)mConfigUi.getContext()).initSecurityFields(mView,
mAccessPointSecurity)) {
return;
}
}
if (mAccessPointSecurity == AccessPoint.SECURITY_NONE) {
mView.findViewById(R.id.security_fields).setVisibility(View.GONE);
return;
} else if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mInXlSetupWizard) {
// In SetupWizard for XLarge screen, we don't have enough space for showing
// configurations needed for EAP. We instead disable the whole feature there and let
// users configure those networks after the setup.
mView.findViewById(R.id.eap_not_supported).setVisibility(View.VISIBLE);
mView.findViewById(R.id.security_fields).setVisibility(View.GONE);
return;
}
mView.findViewById(R.id.security_fields).setVisibility(View.VISIBLE);