Fix bug #16578018 Wi-Fi network list items should be centered with icons

- force correct refresh of the Preference summary
- put some non used code into comment ...

Change-Id: I17fc6fe2cf0717bae613d78cfac2c88d3e160ef4
This commit is contained in:
Fabrice Di Meglio
2014-08-08 13:55:58 -07:00
parent 1f4049edfe
commit cba834dedf

View File

@@ -520,6 +520,10 @@ class AccessPoint extends Preference {
final Context context = getContext(); final Context context = getContext();
updateIcon(getLevel(), context); updateIcon(getLevel(), context);
// Force new summary
setSummary(null);
// Update to new summary
StringBuilder summary = new StringBuilder(); StringBuilder summary = new StringBuilder();
if (mState != null) { // This is the active connection if (mState != null) { // This is the active connection
@@ -551,22 +555,18 @@ class AccessPoint extends Preference {
summary.append(context.getString(R.string.wifi_remembered)); summary.append(context.getString(R.string.wifi_remembered));
} }
if (security != SECURITY_NONE) { // TODO: Wi-Fi team needs to decide what to do with this code.
String securityStrFormat; // if (security != SECURITY_NONE) {
if (summary.length() == 0) { // String securityStrFormat;
securityStrFormat = context.getString(R.string.wifi_secured_first_item); // if (summary.length() == 0) {
} else { // securityStrFormat = context.getString(R.string.wifi_secured_first_item);
securityStrFormat = context.getString(R.string.wifi_secured_second_item); // } else {
} // securityStrFormat = context.getString(R.string.wifi_secured_second_item);
} // }
// }
} }
// This is a workaround, see bug report...
if (summary.length() < 1) {
summary.append(" ");
}
if (WifiSettings.mVerboseLogging > 0) { if (WifiSettings.mVerboseLogging > 0) {
//add RSSI/band information for this config, what was seen up to 6 seconds ago //add RSSI/band information for this config, what was seen up to 6 seconds ago
//verbose WiFi Logging is only turned on thru developers settings //verbose WiFi Logging is only turned on thru developers settings
@@ -591,7 +591,11 @@ class AccessPoint extends Preference {
} }
} }
if (summary.length() > 0) {
setSummary(summary.toString()); setSummary(summary.toString());
} else {
showSummary = false;
}
} }
/** /**