Implement new design of Wi-Fi card
- always show Wi-Fi card - collapse the card in the new UI session when connecting to a stable network - hide toggle, show a level icon and subtext in the new collapsed mode - show loading row when the AP list is not full Test: robotest Fixes: 147473096 Change-Id: I893064ef04d40d8e7cb8e62c1e72a2cb5e97f6ac
This commit is contained in:
@@ -111,10 +111,11 @@ public class WifiScanWorker extends SliceBackgroundWorker<AccessPoint> implement
|
||||
// AccessPoints are sorted by the WifiTracker
|
||||
final List<AccessPoint> accessPoints = mWifiTracker.getAccessPoints();
|
||||
final List<AccessPoint> resultList = new ArrayList<>();
|
||||
final int apRowCount = getApRowCount();
|
||||
for (AccessPoint ap : accessPoints) {
|
||||
if (ap.isReachable()) {
|
||||
resultList.add(clone(ap));
|
||||
if (resultList.size() >= DEFAULT_EXPANDED_ROW_COUNT) {
|
||||
if (resultList.size() >= apRowCount) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -122,6 +123,10 @@ public class WifiScanWorker extends SliceBackgroundWorker<AccessPoint> implement
|
||||
updateResults(resultList);
|
||||
}
|
||||
|
||||
protected int getApRowCount() {
|
||||
return DEFAULT_EXPANDED_ROW_COUNT;
|
||||
}
|
||||
|
||||
private AccessPoint clone(AccessPoint accessPoint) {
|
||||
final Bundle savedState = new Bundle();
|
||||
accessPoint.saveWifiState(savedState);
|
||||
|
Reference in New Issue
Block a user