Small fixes
This commit is contained in:
parent
52f13a7e42
commit
28df99cffb
5 changed files with 4 additions and 38 deletions
|
@ -39,14 +39,6 @@ public abstract class SwitchableAction<T> extends QuickAction {
|
|||
|
||||
protected static final String KEY_DIALOG = "dialog";
|
||||
|
||||
private final static String MAP_STYLE_ACTION = "mapstyle.change";
|
||||
private final static String MAP_SOURCE_ACTION = "mapsource.change";
|
||||
private final static String MAP_OVERLAY_ACTION = "mapoverlay.change";
|
||||
private final static String MAP_UNDERLAY_ACTION = "mapunderlay.change";
|
||||
|
||||
private final static String KEY_NO_OVERLAY = "no_overlay";
|
||||
private final static String KEY_NO_UNDERLAY = "no_underlay";
|
||||
|
||||
private transient EditText title;
|
||||
|
||||
private transient Adapter adapter;
|
||||
|
@ -115,28 +107,10 @@ public abstract class SwitchableAction<T> extends QuickAction {
|
|||
|
||||
@Override
|
||||
public String getActionText(OsmandApplication application) {
|
||||
String currentSource = "";
|
||||
switch (getActionType().getStringId()) {
|
||||
case MAP_STYLE_ACTION:
|
||||
currentSource = application.getSettings().RENDERER.get();
|
||||
break;
|
||||
case MAP_SOURCE_ACTION:
|
||||
currentSource = application.getSettings().MAP_ONLINE_DATA.get()
|
||||
? application.getSettings().MAP_TILE_SOURCES.get()
|
||||
: application.getString(R.string.vector_data);
|
||||
break;
|
||||
case MAP_OVERLAY_ACTION:
|
||||
currentSource = application.getSettings().MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY
|
||||
: application.getSettings().MAP_OVERLAY.get();
|
||||
break;
|
||||
case MAP_UNDERLAY_ACTION:
|
||||
currentSource = application.getSettings().MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY
|
||||
: application.getSettings().MAP_UNDERLAY.get();
|
||||
break;
|
||||
}
|
||||
String item = getSelectedItem(application);
|
||||
String arrowDirection = isLayoutRtl(application) ? "\u25c0" : "\u25b6";
|
||||
|
||||
return application.getString(R.string.ltr_or_rtl_combine_via_space, getTranslatedItemName(application, currentSource), arrowDirection + "\u2026");
|
||||
return application.getString(R.string.ltr_or_rtl_combine_via_space, getTranslatedItemName(application, item), arrowDirection + "\u2026");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,8 +30,6 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.osmand.AndroidUtils.isLayoutRtl;
|
||||
|
||||
public class MapStyleAction extends SwitchableAction<String> {
|
||||
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.osmand.AndroidUtils.isLayoutRtl;
|
||||
|
||||
public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
|
||||
|
||||
private final static String KEY_OVERLAYS = "overlays";
|
||||
|
@ -61,7 +59,7 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
|
||||
@Override
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
return app.getSettings().MAP_OVERLAY.get();
|
||||
return app.getSettings().MAP_OVERLAY.get() != null ? app.getSettings().MAP_OVERLAY.get() : KEY_NO_OVERLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,8 +29,6 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.osmand.AndroidUtils.isLayoutRtl;
|
||||
|
||||
public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
|
||||
|
||||
public static final String LAYER_OSM_VECTOR = "LAYER_OSM_VECTOR";
|
||||
|
|
|
@ -28,8 +28,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.osmand.AndroidUtils.isLayoutRtl;
|
||||
|
||||
|
||||
public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
|
||||
|
||||
|
@ -61,7 +59,7 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
|
||||
@Override
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
return app.getSettings().MAP_UNDERLAY.get();
|
||||
return app.getSettings().MAP_UNDERLAY.get() != null ? app.getSettings().MAP_UNDERLAY.get() : KEY_NO_UNDERLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue