[android] - avoid creating InfoWindow iterator if no InfoWindows are shown (#9477)
This commit is contained in:
@@ -22,7 +22,8 @@ import java.util.List;
|
||||
*/
|
||||
class InfoWindowManager {
|
||||
|
||||
private List<InfoWindow> infoWindows;
|
||||
private final List<InfoWindow> infoWindows = new ArrayList<>();
|
||||
|
||||
private MapboxMap.InfoWindowAdapter infoWindowAdapter;
|
||||
private boolean allowConcurrentMultipleInfoWindows;
|
||||
|
||||
@@ -30,13 +31,11 @@ class InfoWindowManager {
|
||||
private MapboxMap.OnInfoWindowLongClickListener onInfoWindowLongClickListener;
|
||||
private MapboxMap.OnInfoWindowCloseListener onInfoWindowCloseListener;
|
||||
|
||||
InfoWindowManager() {
|
||||
this.infoWindows = new ArrayList<>();
|
||||
}
|
||||
|
||||
void update() {
|
||||
for (InfoWindow infoWindow : infoWindows) {
|
||||
infoWindow.update();
|
||||
if (!infoWindows.isEmpty()) {
|
||||
for (InfoWindow infoWindow : infoWindows) {
|
||||
infoWindow.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,10 +55,6 @@ class InfoWindowManager {
|
||||
return allowConcurrentMultipleInfoWindows;
|
||||
}
|
||||
|
||||
List<InfoWindow> getInfoWindows() {
|
||||
return infoWindows;
|
||||
}
|
||||
|
||||
boolean isInfoWindowValidForMarker(@NonNull Marker marker) {
|
||||
return !TextUtils.isEmpty(marker.getTitle()) || !TextUtils.isEmpty(marker.getSnippet());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user