Add constant for max number of routes badges
This commit is contained in:
parent
7db2c569a8
commit
2005ea4d0c
1 changed files with 6 additions and 1 deletions
|
@ -79,6 +79,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
public static final int ZOOM_IN_STANDARD = 17;
|
||||
|
||||
public static final int CURRENT_Y_UNDEFINED = Integer.MAX_VALUE;
|
||||
|
||||
private static final int MAX_TRANSPORT_ROUTES_BADGES = 6;
|
||||
|
||||
private View view;
|
||||
private InterceptorLinearLayout mainView;
|
||||
|
@ -669,9 +671,12 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
private List<TransportStopRoute> filterTransportRoutes(List<TransportStopRoute> routes) {
|
||||
List<TransportStopRoute> filteredRoutes = new ArrayList<>();
|
||||
for (TransportStopRoute route : routes) {
|
||||
if (filteredRoutes.size() < 6 && !containsRef(filteredRoutes, route.route)) {
|
||||
if (!containsRef(filteredRoutes, route.route)) {
|
||||
filteredRoutes.add(route);
|
||||
}
|
||||
if (filteredRoutes.size() >= MAX_TRANSPORT_ROUTES_BADGES) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return filteredRoutes;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue