From 61a1d69c58c3e2bdbfb217b4f23d43bdc18f0602 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 9 Feb 2021 16:18:20 +0200 Subject: [PATCH] Fix empty activity type --- .../net/osmand/osm/RouteActivityType.java | 2 +- .../explore/SavedArticlesRvAdapter.java | 25 +++++++++++++++---- .../explore/travelcards/TravelGpxCard.java | 16 ++++++++---- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/RouteActivityType.java b/OsmAnd-java/src/main/java/net/osmand/osm/RouteActivityType.java index 65fa50bf68..7c54388f64 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/RouteActivityType.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/RouteActivityType.java @@ -43,7 +43,7 @@ public class RouteActivityType { return icon; } - public static RouteActivityType getTypeFromName(String name) { + public static RouteActivityType getOrCreateTypeFromName(String name) { for (RouteActivityType rat : values) { if (rat.name.equalsIgnoreCase(name)) { return rat; diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java index 002b5587d4..9bccece08d 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java @@ -18,12 +18,13 @@ import com.squareup.picasso.Callback; import com.squareup.picasso.Picasso; import com.squareup.picasso.RequestCreator; +import net.osmand.AndroidUtils; import net.osmand.PicassoUtils; +import net.osmand.osm.RouteActivityType; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; -import net.osmand.plus.profiles.ProfileIcons; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.widgets.tools.CropCircleTransformation; import net.osmand.plus.wikipedia.WikiArticleHelper; @@ -37,6 +38,7 @@ import java.util.ArrayList; import java.util.List; import static net.osmand.plus.wikivoyage.explore.travelcards.TravelGpxCard.*; +import static net.osmand.util.Algorithms.capitalizeFirstLetterAndLowercase; public class SavedArticlesRvAdapter extends RecyclerView.Adapter { @@ -140,10 +142,12 @@ public class SavedArticlesRvAdapter extends RecyclerView.Adapter