From 01eb699e3b6eadf606595ce7ecd223f4b2d9d262 Mon Sep 17 00:00:00 2001
From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com>
Date: Thu, 8 Apr 2021 14:03:52 +0300
Subject: [PATCH 01/11] Plan route: Hide Widgets. Show: Compass, configure map,
search
---
.../osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java
index 4c538ddba1..fd2d873a29 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java
@@ -104,7 +104,6 @@ public class WidgetsVisibilityHelper {
public boolean shouldHideCompass() {
return mapActivity.shouldHideTopControls()
|| isTrackDetailsMenuOpened()
- || isInMeasurementToolMode()
|| isInPlanRouteMode()
|| isInChoosingRoutesMode()
|| isInTrackAppearanceMode()
@@ -116,7 +115,6 @@ public class WidgetsVisibilityHelper {
public boolean shouldShowTopButtons() {
return !mapActivity.shouldHideTopControls()
&& !isTrackDetailsMenuOpened()
- && !isInMeasurementToolMode()
&& !isInPlanRouteMode()
&& !isInChoosingRoutesMode()
&& !isInTrackAppearanceMode()
From 388be5c3ef02fe744f2c07b0b3935822fd69d4ae Mon Sep 17 00:00:00 2001
From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com>
Date: Thu, 8 Apr 2021 23:07:02 +0300
Subject: [PATCH 02/11] =?UTF-8?q?Hide=20widgets:=20Select=20track=20on=20t?=
=?UTF-8?q?he=20map,=20tap=20on=20the=20"Edit"=20button,=20"Plan=20route"?=
=?UTF-8?q?=20will=20be=20opened,=20map=20widgets=20will=20be=20visible.?=
=?UTF-8?q?=20If=20you=20open=20Menu=20=E2=80=93=20Plan=20Route=20?=
=?UTF-8?q?=E2=80=93=20Select=20the=20same=20track,=20widgets=20would=20be?=
=?UTF-8?q?=20visible.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java | 2 +-
.../plus/views/mapwidgets/WidgetsVisibilityHelper.java | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java
index e1a620269d..ae32e57fef 100644
--- a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java
@@ -841,9 +841,9 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
osmEditingPlugin.sendGPXFiles(mapActivity, this, gpxInfo);
}
} else if (buttonIndex == EDIT_BUTTON_INDEX) {
+ dismiss();
String fileName = Algorithms.getFileWithoutDirs(gpxFile.path);
MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), fileName);
- dismiss();
} else if (buttonIndex == RENAME_BUTTON_INDEX) {
FileUtils.renameFile(mapActivity, new File(gpxFile.path), this, true);
} else if (buttonIndex == CHANGE_FOLDER_BUTTON_INDEX) {
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java
index fd2d873a29..72d8814a80 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/WidgetsVisibilityHelper.java
@@ -21,10 +21,10 @@ import java.lang.ref.WeakReference;
public class WidgetsVisibilityHelper {
- private MapActivity mapActivity;
- private OsmandSettings settings;
- private RoutingHelper routingHelper;
- private MapActivityLayers mapLayers;
+ private final MapActivity mapActivity;
+ private final OsmandSettings settings;
+ private final RoutingHelper routingHelper;
+ private final MapActivityLayers mapLayers;
public WidgetsVisibilityHelper(@NonNull MapActivity mapActivity) {
this.mapActivity = mapActivity;
From 3560de5e3e82df9633ff49614bc6cc5bdb16c72f Mon Sep 17 00:00:00 2001
From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com>
Date: Fri, 9 Apr 2021 14:02:27 +0300
Subject: [PATCH 03/11] Review
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Use this arrow LTR: "▶", RTL: "◀".
Check how it work with RTL.
---
OsmAnd/res/values/strings.xml | 2 +-
.../quickaction/actions/MapStyleAction.java | 9 ++++++---
.../plus/rastermaps/MapOverlayAction.java | 7 +++++--
.../osmand/plus/rastermaps/MapSourceAction.java | 17 ++++++++++-------
.../plus/rastermaps/MapUnderlayAction.java | 9 ++++++---
5 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 97cfcf3a42..5bac9b0326 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -12,7 +12,7 @@
-->
- %1$s → …
+ %1$s %2$s …
Output
User points
Announce when exceeded
diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java
index 5838bfc1a2..c487cd494c 100644
--- a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java
+++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapStyleAction.java
@@ -30,6 +30,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import static net.osmand.AndroidUtils.isLayoutRtl;
+
public class MapStyleAction extends SwitchableAction {
@@ -54,7 +56,7 @@ public class MapStyleAction extends SwitchableAction {
if (current != null) {
return current.getName();
} else {
- return RendererRegistry.DEFAULT_RENDER;
+ return RendererRegistry.DEFAULT_RENDER;
}
}
@@ -77,7 +79,7 @@ public class MapStyleAction extends SwitchableAction {
executeWithParams(activity, nextStyle);
} else {
Toast.makeText(activity, R.string.quick_action_need_to_add_item_to_list,
- Toast.LENGTH_LONG).show();
+ Toast.LENGTH_LONG).show();
}
}
@@ -249,7 +251,8 @@ public class MapStyleAction extends SwitchableAction {
@Override
public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().RENDERER.get();
+ String arrowDirection = isLayoutRtl(application) ? "\u25c0" : "\u25b6";
- return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
+ return application.getString(R.string.map_quick_action_arrow_direction_pattern, getTranslatedItemName(application, currentSource), arrowDirection);
}
}
\ 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 8190b6c995..cc01b93e24 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/MapOverlayAction.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/MapOverlayAction.java
@@ -15,19 +15,21 @@ import com.google.gson.reflect.TypeToken;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionType;
import net.osmand.plus.quickaction.SwitchableAction;
+import net.osmand.plus.settings.backend.OsmandSettings;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import static net.osmand.AndroidUtils.isLayoutRtl;
+
public class MapOverlayAction extends SwitchableAction> {
private final static String KEY_OVERLAYS = "overlays";
@@ -229,7 +231,8 @@ public class MapOverlayAction extends SwitchableAction> {
public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY
: application.getSettings().MAP_OVERLAY.get();
+ String arrowDirection = isLayoutRtl(application) ? "\u25c0" : "\u25b6";
- return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
+ return application.getString(R.string.map_quick_action_arrow_direction_pattern, getTranslatedItemName(application, currentSource), arrowDirection);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java b/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java
index d81b1f12ed..187e6e262a 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/MapSourceAction.java
@@ -15,13 +15,13 @@ import com.google.gson.reflect.TypeToken;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionType;
import net.osmand.plus.quickaction.SwitchableAction;
+import net.osmand.plus.settings.backend.OsmandSettings;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -29,6 +29,8 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import static net.osmand.AndroidUtils.isLayoutRtl;
+
public class MapSourceAction extends SwitchableAction> {
public static final String LAYER_OSM_VECTOR = "LAYER_OSM_VECTOR";
@@ -98,8 +100,8 @@ public class MapSourceAction extends SwitchableAction> {
}
Pair currentSource = settings.MAP_ONLINE_DATA.get()
- ? new Pair<>(settings.MAP_TILE_SOURCES.get(), settings.MAP_TILE_SOURCES.get())
- : new Pair<>(LAYER_OSM_VECTOR, activity.getString(R.string.vector_data));
+ ? new Pair<>(settings.MAP_TILE_SOURCES.get(), settings.MAP_TILE_SOURCES.get())
+ : new Pair<>(LAYER_OSM_VECTOR, activity.getString(R.string.vector_data));
Pair nextSource = sources.get(0);
int index = sources.indexOf(currentSource);
@@ -135,7 +137,7 @@ public class MapSourceAction extends SwitchableAction> {
return item;
}
}
-
+
@Override
protected int getAddBtnText() {
return R.string.quick_action_map_source_action;
@@ -218,9 +220,10 @@ public class MapSourceAction extends SwitchableAction> {
@Override
public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().MAP_ONLINE_DATA.get()
- ? application.getSettings().MAP_TILE_SOURCES.get()
- : application.getString(R.string.vector_data);
+ ? application.getSettings().MAP_TILE_SOURCES.get()
+ : application.getString(R.string.vector_data);
+ String arrowDirection = isLayoutRtl(application) ? "\u25c0" : "\u25b6";
- return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
+ return application.getString(R.string.map_quick_action_arrow_direction_pattern, getTranslatedItemName(application, currentSource), arrowDirection);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java b/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java
index ddb941e10b..fa7aae54c0 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/MapUnderlayAction.java
@@ -28,6 +28,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import static net.osmand.AndroidUtils.isLayoutRtl;
+
public class MapUnderlayAction extends SwitchableAction> {
@@ -103,7 +105,7 @@ public class MapUnderlayAction extends SwitchableAction> {
int index = -1;
final String currentSource = settings.MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY
- : settings.MAP_UNDERLAY.get();
+ : settings.MAP_UNDERLAY.get();
for (int idx = 0; idx < sources.size(); idx++) {
if (sources.get(idx).first.equals(currentSource)) {
@@ -157,7 +159,7 @@ public class MapUnderlayAction extends SwitchableAction> {
return item;
}
}
-
+
@Override
protected int getAddBtnText() {
return R.string.quick_action_map_underlay_action;
@@ -231,7 +233,8 @@ public class MapUnderlayAction extends SwitchableAction> {
public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY
: application.getSettings().MAP_UNDERLAY.get();
+ String arrowDirection = isLayoutRtl(application) ? "\u25c0" : "\u25b6";
- return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
+ return application.getString(R.string.map_quick_action_arrow_direction_pattern, getTranslatedItemName(application, currentSource), arrowDirection);
}
}
From 60b346373f94a68c7db5ae766dbac121a73d2767 Mon Sep 17 00:00:00 2001
From: Vitaliy
Date: Sun, 11 Apr 2021 12:19:49 +0300
Subject: [PATCH 04/11] Fix MapMultiSelectionMenu menu for tracks
---
.../plus/audionotes/AudioNotesLayer.java | 5 +++++
.../plus/mapillary/MapillaryVectorLayer.java | 6 +++++
.../measurementtool/MeasurementToolLayer.java | 6 +++++
.../net/osmand/plus/osmedit/OsmBugsLayer.java | 6 +++++
.../osmand/plus/osmedit/OsmEditsLayer.java | 5 +++++
.../plus/views/layers/AidlMapLayer.java | 10 +++++++--
.../plus/views/layers/ContextMenuLayer.java | 4 +++-
.../views/layers/DownloadedRegionsLayer.java | 6 +++++
.../plus/views/layers/FavouritesLayer.java | 5 +++++
.../osmand/plus/views/layers/GPXLayer.java | 22 +++++++++++--------
.../views/layers/ImpassableRoadsLayer.java | 5 +++++
.../plus/views/layers/MapMarkersLayer.java | 5 +++++
.../osmand/plus/views/layers/POIMapLayer.java | 6 +++++
.../plus/views/layers/PointLocationLayer.java | 11 ++++++++--
.../views/layers/PointNavigationLayer.java | 9 +++++++-
.../osmand/plus/views/layers/RouteLayer.java | 8 ++++++-
.../views/layers/TransportStopsLayer.java | 15 +++++++++----
17 files changed, 114 insertions(+), 20 deletions(-)
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java
index 96ce49d8db..727e7d683b 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java
@@ -169,6 +169,11 @@ public class AudioNotesLayer extends OsmandMapLayer implements
return false;
}
+ @Override
+ public boolean showMenuAction(@Nullable Object o) {
+ return false;
+ }
+
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List