From ac87261ade93ed2badd734212ec8953179268876 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 24 Jan 2020 18:36:42 +0200 Subject: [PATCH] Fix custom favorite icons --- .../main/java/net/osmand/GPXUtilities.java | 9 ++++++-- OsmAnd/res/layout/favorites_list_item.xml | 4 +++- .../src/net/osmand/data/FavouritePoint.java | 8 ++++++- .../plus/base/FavoriteImageDrawable.java | 21 ++++++++++--------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index 47705ec8ed..1716464c30 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -42,7 +42,8 @@ import java.util.TimeZone; public class GPXUtilities { public final static Log log = PlatformUtil.getLog(GPXUtilities.class); - private static final String ICON_NAME_EXTENSION = "icon_name"; + private static final String ICON_NAME_EXTENSION = "icon"; + private static final String DEFAULT_ICON_NAME = "special_star"; private final static String GPX_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; //$NON-NLS-1$ private final static String GPX_TIME_FORMAT_MILLIS = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; //$NON-NLS-1$ @@ -259,7 +260,11 @@ public class GPXUtilities { } public String getIconName() { - return getExtensionsToRead().get(ICON_NAME_EXTENSION); + String iconName = getExtensionsToRead().get(ICON_NAME_EXTENSION); + if (iconName == null) { + iconName = DEFAULT_ICON_NAME; + } + return iconName; } public void setIconName(String iconName) { diff --git a/OsmAnd/res/layout/favorites_list_item.xml b/OsmAnd/res/layout/favorites_list_item.xml index fbde9d514d..202c4cc6c5 100644 --- a/OsmAnd/res/layout/favorites_list_item.xml +++ b/OsmAnd/res/layout/favorites_list_item.xml @@ -53,7 +53,9 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:orientation="vertical" - android:paddingRight="@dimen/list_content_padding"> + android:paddingTop="6dp" + android:paddingRight="@dimen/list_content_padding" + android:paddingBottom="6dp">