Use this arrow LTR: "▶", RTL: "◀".
Check how it work with RTL.
This commit is contained in:
androiddevkotlin 2021-04-09 14:02:27 +03:00
parent 1b1132148f
commit 3560de5e3e
5 changed files with 28 additions and 16 deletions

View file

@ -12,7 +12,7 @@
--> -->
<string name="map_quick_action_pattern">%1$s →</string> <string name="map_quick_action_arrow_direction_pattern">%1$s %2$s</string>
<string name="output">Output</string> <string name="output">Output</string>
<string name="user_points">User points</string> <string name="user_points">User points</string>
<string name="announce_when_exceeded">Announce when exceeded</string> <string name="announce_when_exceeded">Announce when exceeded</string>

View file

@ -30,6 +30,8 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static net.osmand.AndroidUtils.isLayoutRtl;
public class MapStyleAction extends SwitchableAction<String> { public class MapStyleAction extends SwitchableAction<String> {
@ -249,7 +251,8 @@ public class MapStyleAction extends SwitchableAction<String> {
@Override @Override
public String getActionText(OsmandApplication application) { public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().RENDERER.get(); 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);
} }
} }

View file

@ -15,19 +15,21 @@ import com.google.gson.reflect.TypeToken;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionType; import net.osmand.plus.quickaction.QuickActionType;
import net.osmand.plus.quickaction.SwitchableAction; import net.osmand.plus.quickaction.SwitchableAction;
import net.osmand.plus.settings.backend.OsmandSettings;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static net.osmand.AndroidUtils.isLayoutRtl;
public class MapOverlayAction extends SwitchableAction<Pair<String, String>> { public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
private final static String KEY_OVERLAYS = "overlays"; private final static String KEY_OVERLAYS = "overlays";
@ -229,7 +231,8 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
public String getActionText(OsmandApplication application) { public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY String currentSource = application.getSettings().MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY
: application.getSettings().MAP_OVERLAY.get(); : 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);
} }
} }

View file

@ -15,13 +15,13 @@ import com.google.gson.reflect.TypeToken;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionType; import net.osmand.plus.quickaction.QuickActionType;
import net.osmand.plus.quickaction.SwitchableAction; import net.osmand.plus.quickaction.SwitchableAction;
import net.osmand.plus.settings.backend.OsmandSettings;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.ArrayList; import java.util.ArrayList;
@ -29,6 +29,8 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static net.osmand.AndroidUtils.isLayoutRtl;
public class MapSourceAction extends SwitchableAction<Pair<String, String>> { public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
public static final String LAYER_OSM_VECTOR = "LAYER_OSM_VECTOR"; public static final String LAYER_OSM_VECTOR = "LAYER_OSM_VECTOR";
@ -220,7 +222,8 @@ public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
String currentSource = application.getSettings().MAP_ONLINE_DATA.get() String currentSource = application.getSettings().MAP_ONLINE_DATA.get()
? application.getSettings().MAP_TILE_SOURCES.get() ? application.getSettings().MAP_TILE_SOURCES.get()
: application.getString(R.string.vector_data); : 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);
} }
} }

View file

@ -28,6 +28,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static net.osmand.AndroidUtils.isLayoutRtl;
public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> { public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
@ -231,7 +233,8 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
public String getActionText(OsmandApplication application) { public String getActionText(OsmandApplication application) {
String currentSource = application.getSettings().MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY String currentSource = application.getSettings().MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY
: application.getSettings().MAP_UNDERLAY.get(); : 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);
} }
} }