Fix category does'n create, align text with direction marker.

This commit is contained in:
Dima-1 2020-01-13 11:12:56 +02:00
parent 3d8756459d
commit f464ae192d
2 changed files with 5 additions and 5 deletions

View file

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

View file

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