Merge pull request #8218 from osmandapp/personal_favs_refactor

Fix category does'n created, align text with direction marker.
This commit is contained in:
max-klaus 2020-01-13 12:43:31 +03:00 committed by GitHub
commit d06aa25cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -72,8 +72,9 @@
android:id="@+id/direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_direction_arrow"/>
android:layout_gravity="top"
android:layout_marginTop="2dp"
android:src="@drawable/ic_direction_arrow" />
<TextView
android:id="@+id/distance"

View file

@ -577,13 +577,12 @@ public class FavouritesDbHelper {
}
public void addEmptyCategory(String name, int color) {
if (FavoriteGroup.isPersonalCategoryDisplayName(context,name))
addEmptyCategory(name, color, true);
}
public void addEmptyCategory(String name, int color, boolean visible) {
FavoriteGroup group = new FavoriteGroup();
group.name = name;
group.name = FavoriteGroup.convertDisplayNameToGroupIdName(context, name);
group.color = color;
group.visible = visible;
favoriteGroups.add(group);
@ -621,7 +620,7 @@ public class FavouritesDbHelper {
public boolean groupExists(String name) {
String nameLowercase = name.toLowerCase();
for (String groupName : flatGroups.keySet()) {
if (groupName.toLowerCase().equals(nameLowercase)) {
if (groupName.toLowerCase().equals(nameLowercase) || FavoriteGroup.getDisplayName(context, groupName).equals(name)) {
return true;
}
}