Fix #3577 Announce only visible favorites

This commit is contained in:
Victor Shcherb 2017-03-24 23:19:04 +01:00
parent 5035ecb061
commit 6523575e1d
2 changed files with 11 additions and 1 deletions

View file

@ -433,6 +433,16 @@ public class FavouritesDbHelper {
return cachedFavoritePoints;
}
public List<FavouritePoint> getVisibleFavouritePoints() {
List<FavouritePoint> fp = new ArrayList<>();
for(FavouritePoint p : cachedFavoritePoints) {
if(p.isVisible()) {
fp.add(p);
}
}
return fp;
}
public List<FavoriteGroup> getFavoriteGroups() {
return favoriteGroups;

View file

@ -473,7 +473,7 @@ public class WaypointHelper {
if ((type == FAVORITES || all)) {
final List<LocationPointWrapper> array = clearAndGetArray(locationPoints, FAVORITES);
if (showFavorites) {
findLocationPoints(route, FAVORITES, array, app.getFavorites().getFavouritePoints(),
findLocationPoints(route, FAVORITES, array, app.getFavorites().getVisibleFavouritePoints(),
announceFavorites);
sortList(array);
}