Remove the ability to add groups with the same name
This commit is contained in:
parent
6cd6e7ea63
commit
f6aeaed8d1
1 changed files with 6 additions and 0 deletions
|
@ -358,6 +358,12 @@ public class OsmandAidlApi {
|
||||||
boolean addFavoriteGroup(AFavoriteGroup favoriteGroup) {
|
boolean addFavoriteGroup(AFavoriteGroup favoriteGroup) {
|
||||||
if (favoriteGroup != null) {
|
if (favoriteGroup != null) {
|
||||||
FavouritesDbHelper favoritesHelper = app.getFavorites();
|
FavouritesDbHelper favoritesHelper = app.getFavorites();
|
||||||
|
List<FavouritesDbHelper.FavoriteGroup> groups = favoritesHelper.getFavoriteGroups();
|
||||||
|
for (FavouritesDbHelper.FavoriteGroup g : groups) {
|
||||||
|
if (g.name.equals(favoriteGroup.getName())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
int color = 0;
|
int color = 0;
|
||||||
if (!Algorithms.isEmpty(favoriteGroup.getColor())) {
|
if (!Algorithms.isEmpty(favoriteGroup.getColor())) {
|
||||||
color = ColorDialogs.getColorByTag(favoriteGroup.getColor());
|
color = ColorDialogs.getColorByTag(favoriteGroup.getColor());
|
||||||
|
|
Loading…
Reference in a new issue