diff options
author | Daisuke Miyakawa <dmiyakawa@google.com> | 2010-09-13 15:26:43 -0700 |
---|---|---|
committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2010-09-15 12:57:34 -0700 |
commit | b962d6566c99edf9950b5d05c5f08c56d1f850fe (patch) | |
tree | fadfc53c3a247f95fd21222bc8889ef73ee8f43e /src | |
parent | 746d913e0b5f5da50961badcc56c2ab95fb5f34d (diff) | |
download | packages_apps_Settings-b962d6566c99edf9950b5d05c5f08c56d1f850fe.zip packages_apps_Settings-b962d6566c99edf9950b5d05c5f08c56d1f850fe.tar.gz packages_apps_Settings-b962d6566c99edf9950b5d05c5f08c56d1f850fe.tar.bz2 |
SetupWizard improvement: let users see "scanning"
Current UI shows nothing when there's no connection available, even when
the device is finding some. So user cannot know whether the static
"Not connected" screen means: the device is finding right now, or
actually no network is available.
Change-Id: Ia8ea1c66956e8de819f6a98362bcc9086bda172c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/wifi/WifiSettings.java | 8 | ||||
-rw-r--r-- | src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java | 26 |
2 files changed, 27 insertions, 7 deletions
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index acb9ad3..905f2a3 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -667,4 +667,12 @@ public class WifiSettings extends SettingsPreferenceFragment mSelectedAccessPoint = null; showConfigUi(null, true); } + + /* package */ int getAccessPointsCount() { + if (mAccessPoints != null) { + return mAccessPoints.getPreferenceCount(); + } else { + return 0; + } + } } diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java index 2d26645..ef827f6 100644 --- a/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java +++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java @@ -40,7 +40,7 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis static { stateMap.put(DetailedState.IDLE, DetailedState.DISCONNECTED); - stateMap.put(DetailedState.SCANNING, DetailedState.DISCONNECTED); + stateMap.put(DetailedState.SCANNING, DetailedState.SCANNING); stateMap.put(DetailedState.CONNECTING, DetailedState.CONNECTING); stateMap.put(DetailedState.AUTHENTICATING, DetailedState.CONNECTING); stateMap.put(DetailedState.OBTAINING_IPADDR, DetailedState.CONNECTING); @@ -111,28 +111,40 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis public void updateConnectionState(DetailedState originalState) { final DetailedState state = stateMap.get(originalState); - final String message; - mProgressBar.setIndeterminate(false); switch (state) { + case SCANNING: { + // Let users know the device is working correctly though currently there's + // no visible network on the list. + if (mWifiSettings.getAccessPointsCount() == 0) { + mProgressBar.setIndeterminate(true); + mProgressText.setText(Summary.get(this, DetailedState.SCANNING)); + } else { + // Users already already connected to a network, or see available networks. + mProgressBar.setIndeterminate(false); + } + break; + } case CONNECTING: { - message = Summary.get(this, state); + mProgressBar.setIndeterminate(false); mProgressBar.setProgress(1); mStatusText.setText(R.string.wifi_setup_status_connecting); + mProgressText.setText(Summary.get(this, state)); break; } case CONNECTED: { - message = Summary.get(this, state); + mProgressBar.setIndeterminate(false); mProgressBar.setProgress(2); mStatusText.setText(R.string.wifi_setup_status_connected); + mProgressText.setText(Summary.get(this, state)); break; } default: // Not connected. - message = getString(R.string.wifi_setup_not_connected); + mProgressBar.setIndeterminate(false); mProgressBar.setProgress(0); mStatusText.setText(R.string.wifi_setup_status_select_network); + mProgressText.setText(getString(R.string.wifi_setup_not_connected)); break; } - mProgressText.setText(message); } public void onWifiConfigPreferenceAttached(boolean isNewNetwork) { |