Improve UI of WifiSettingsForXL
Change-Id: Idd25251581577246ff3fb6820b9c569454292593
This commit is contained in:
@@ -2703,6 +2703,9 @@ found in the list of installed applications.</string>
|
||||
Used in Wifi Setup For Setup Wizard with XL screen. -->
|
||||
<string name="wifi_setup_next">Next</string>
|
||||
|
||||
<!-- The message shown above available networks when the device is scanning
|
||||
available networks [CHAR LIMIT=35] -->
|
||||
<string name="wifi_setup_status_scanning">Scanning networks...</string>
|
||||
<!-- Message shown above available network when there's no connected network.
|
||||
Used in Wifi Setup For Setup Wizard with XL screen. -->
|
||||
<string name="wifi_setup_status_select_network">Touch to select network</string>
|
||||
@@ -2722,15 +2725,14 @@ found in the list of installed applications.</string>
|
||||
is established.
|
||||
Used in Wifi Setup For Setup Wizard with XL screen. -->
|
||||
<string name="wifi_setup_status_connecting">Connecting...</string>
|
||||
<!-- The message show above available networks when connection is established.
|
||||
Used in Wifi Setup For Setup Wizard with XL screen. -->
|
||||
<string name="wifi_setup_status_connected">Connected</string>
|
||||
<!-- The message shown above available networks when connection is established,
|
||||
letting a user to proceed to the next step of the SetupWizard.
|
||||
Used in Wifi Setup For Setup Wizard with XL screen. [CHAR LIMIT=35] -->
|
||||
<string name="wifi_setup_status_proceed_to_next">Proceed to the next step</string>
|
||||
|
||||
<!-- Do not translate. This is a stub which will be removed soon. -->
|
||||
<string name="time_zone_auto_stub" translatable="false">Select Time Zone</string>
|
||||
|
||||
|
||||
|
||||
<!-- Message when sync is currently failing [CHAR LIMIT=100] -->
|
||||
<string name="sync_is_failing">Sync is currently experiencing problems. It will be back shortly.</string>
|
||||
<!-- Button label to add an account [CHAR LIMIT=20] -->
|
||||
|
@@ -688,6 +688,7 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
|
||||
/* package */ void refreshAccessPoints() {
|
||||
mWifiManager.disconnect();
|
||||
if (mWifiManager.isWifiEnabled()) {
|
||||
mScanner.resume();
|
||||
}
|
||||
|
@@ -65,10 +65,15 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
private InputMethodManager mInputMethodManager;
|
||||
|
||||
// This count reduces every time when there's a notification about WiFi status change.
|
||||
// During the term this is >0, The system shows the message "connecting", regardless
|
||||
// of the actual WiFi status. After this count's becoming 0, the status message correctly
|
||||
// reflects what WiFi Picker told it. This is a tweak for letting users not confused
|
||||
// with instable WiFi state during the first scan.
|
||||
// During the term this is >0, The system refrains some actions which are not appropriate
|
||||
// at that timing.
|
||||
// - When network is connected at that timing, this screen doesn't call finish().
|
||||
// This count is set to 0 when being detected (not decremente).
|
||||
// - When network status is "disconnected", we just show the message "connecting"
|
||||
// regardless of the actual WiFi status.
|
||||
// (After this count's becoming 0, the status message correctly reflects what WiFi Picker
|
||||
// told it)
|
||||
// This is a tweak for letting users not confused with WiFi state during a first first steps.
|
||||
private int mIgnoringWifiNotificationCount = 5;
|
||||
|
||||
@Override
|
||||
@@ -84,6 +89,11 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
getIntent().putExtra(WifiSettings.IN_XL_SETUP_WIZARD, true);
|
||||
|
||||
mStatusBarManager = (StatusBarManager)getSystemService(Context.STATUS_BAR_SERVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (mStatusBarManager != null) {
|
||||
mStatusBarManager.disable(StatusBarManager.DISABLE_EXPAND
|
||||
| StatusBarManager.DISABLE_NOTIFICATION_ICONS
|
||||
@@ -96,21 +106,23 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
public void onStop() {
|
||||
if (mStatusBarManager != null) {
|
||||
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);
|
||||
}
|
||||
super.onDestroy();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
mProgressText = (TextView)findViewById(R.id.scanning_progress_text);
|
||||
mProgressText.setText(Summary.get(this, DetailedState.SCANNING));
|
||||
mProgressBar = (ProgressBar)findViewById(R.id.scanning_progress_bar);
|
||||
mProgressBar.setMax(2);
|
||||
mProgressBar.setIndeterminate(true);
|
||||
mStatusText = (TextView)findViewById(R.id.wifi_setup_status);
|
||||
|
||||
mProgressText.setText(Summary.get(this, DetailedState.SCANNING));
|
||||
mProgressBar.setIndeterminate(true);
|
||||
mStatusText.setText(R.string.wifi_setup_status_scanning);
|
||||
|
||||
((Button)findViewById(R.id.wifi_setup_refresh_list)).setOnClickListener(this);
|
||||
((Button)findViewById(R.id.wifi_setup_add_network)).setOnClickListener(this);
|
||||
((Button)findViewById(R.id.wifi_setup_skip_or_next)).setOnClickListener(this);
|
||||
@@ -181,10 +193,18 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
case CONNECTED: {
|
||||
mProgressBar.setIndeterminate(false);
|
||||
mProgressBar.setProgress(2);
|
||||
mStatusText.setText(R.string.wifi_setup_status_connected);
|
||||
mProgressText.setText(Summary.get(this, state));
|
||||
mStatusText.setText(R.string.wifi_setup_status_proceed_to_next);
|
||||
|
||||
if (mIgnoringWifiNotificationCount > 0) {
|
||||
// The network is already available before doing anything. We avoid skip this
|
||||
// screen to avoid unnecessary trouble by doing so.
|
||||
mIgnoringWifiNotificationCount = 0;
|
||||
} else {
|
||||
mProgressText.setText(Summary.get(this, state));
|
||||
setResult(Activity.RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FAILED: {
|
||||
@@ -200,7 +220,6 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
mIgnoringWifiNotificationCount--;
|
||||
mProgressBar.setIndeterminate(true);
|
||||
mProgressText.setText(Summary.get(this, DetailedState.SCANNING));
|
||||
return;
|
||||
} else {
|
||||
mProgressBar.setIndeterminate(false);
|
||||
mProgressBar.setProgress(0);
|
||||
@@ -222,8 +241,9 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
}
|
||||
|
||||
public void onRefreshAccessPoints() {
|
||||
mIgnoringWifiNotificationCount = 5;
|
||||
mProgressBar.setIndeterminate(true);
|
||||
mProgressText.setText(Summary.get(this, DetailedState.SCANNING));
|
||||
mStatusText.setText(Summary.get(this, DetailedState.SCANNING));
|
||||
mStatusText.setText(R.string.wifi_setup_status_scanning);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user