From bf6d5f0b838bcbccf8d869753f82fe1d6217ce9f Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Thu, 1 Apr 2021 12:30:38 +0300 Subject: [PATCH] Change map quick widget naming style using arrow and three dots --- OsmAnd/res/values/strings.xml | 2 +- .../plus/quickaction/actions/MapStyleAction.java | 6 ++---- .../net/osmand/plus/rastermaps/MapOverlayAction.java | 7 +++---- .../net/osmand/plus/rastermaps/MapSourceAction.java | 10 ++++------ .../net/osmand/plus/rastermaps/MapUnderlayAction.java | 7 +++---- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 5cb21e97eb..b4e3e4fdc2 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,7 +12,7 @@ --> - %1$s + %2$d + %1$s → … Update all maps added to %1$s? • OsmAnd Live updates moved to \"Downloads > Updates\"\n\n diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java index 1e2a8e097e..0938e4d121 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java @@ -248,10 +248,8 @@ public class MapStyleAction extends SwitchableAction { @Override public String getActionText(OsmandApplication application) { - List mapStyles = getFilteredStyles(); - int mapCount = mapStyles.size() - 1; - String name = application.getSettings().RENDERER.get(); + String currentSource = application.getSettings().RENDERER.get(); - return application.getString(R.string.ltr_or_rtl_combine_via_plus, name, mapCount); + return application.getString(R.string.map_quick_action_pattern, currentSource); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/MapOverlayAction.java b/OsmAnd/src/net/osmand/plus/rastermaps/MapOverlayAction.java index 15ae55cfae..41ae2b709b 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/MapOverlayAction.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/MapOverlayAction.java @@ -227,10 +227,9 @@ public class MapOverlayAction extends SwitchableAction> { @Override public String getActionText(OsmandApplication application) { - List> sources = loadListFromParams(); - int mapCount = sources.size() - 1; - String name = application.getSettings().MAP_OVERLAY.get(); + String currentSource = application.getSettings().MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY + : application.getSettings().MAP_OVERLAY.get(); - return application.getString(R.string.ltr_or_rtl_combine_via_plus, name, mapCount); + return application.getString(R.string.map_quick_action_pattern, currentSource); } } diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java b/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java index 556f8bbd61..86043763ea 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java @@ -217,12 +217,10 @@ public class MapSourceAction extends SwitchableAction> { @Override public String getActionText(OsmandApplication application) { - Pair currentSource = application.getSettings().MAP_ONLINE_DATA.get() - ? new Pair<>(application.getSettings().MAP_TILE_SOURCES.get(), application.getSettings().MAP_TILE_SOURCES.get()) - : new Pair<>(LAYER_OSM_VECTOR, application.getString(R.string.vector_data)); - final LinkedHashMap entriesMap = new LinkedHashMap<>(); - int mapCount = entriesMap.size() - 1; + String currentSource = application.getSettings().MAP_ONLINE_DATA.get() + ? application.getSettings().MAP_TILE_SOURCES.get() + : application.getString(R.string.vector_data); - return application.getString(R.string.ltr_or_rtl_combine_via_plus, currentSource, mapCount); + return application.getString(R.string.map_quick_action_pattern, currentSource); } } diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java b/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java index 0bb2838b36..bb3708ba03 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java @@ -229,10 +229,9 @@ public class MapUnderlayAction extends SwitchableAction> { @Override public String getActionText(OsmandApplication application) { - List> sources = loadListFromParams(); - int mapCount = sources.size() - 1; - String name = application.getSettings().MAP_UNDERLAY.get(); + String currentSource = application.getSettings().MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY + : application.getSettings().MAP_UNDERLAY.get(); - return application.getString(R.string.ltr_or_rtl_combine_via_plus, name, mapCount); + return application.getString(R.string.map_quick_action_pattern, currentSource); } }