Merge pull request #11310 from osmandapp/current-map-name
Quick action map: suggestion to display current map name
This commit is contained in:
commit
f2645a064f
5 changed files with 36 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
-->
|
||||
|
||||
<string name="map_quick_action_pattern">%1$s → …</string>
|
||||
<string name="update_all_maps_added">Update all maps added to %1$s?</string>
|
||||
<string name="release_4_0_beta">
|
||||
• OsmAnd Live updates moved to \"Downloads > Updates\"\n\n
|
||||
|
|
|
@ -245,4 +245,11 @@ public class MapStyleAction extends SwitchableAction<String> {
|
|||
? filters.get(0) + " +" + (filters.size() - 1)
|
||||
: filters.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActionText(OsmandApplication application) {
|
||||
String currentSource = application.getSettings().RENDERER.get();
|
||||
|
||||
return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
|
||||
}
|
||||
}
|
|
@ -104,8 +104,8 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
}
|
||||
|
||||
int index = -1;
|
||||
final String currentSource = settings.MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY
|
||||
: settings.MAP_OVERLAY.get();
|
||||
String currentSource = settings.MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY
|
||||
: settings.MAP_OVERLAY.get();
|
||||
|
||||
for (int idx = 0; idx < sources.size(); idx++) {
|
||||
if (sources.get(idx).first.equals(currentSource)) {
|
||||
|
@ -224,4 +224,12 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
getParams().put(KEY_DIALOG, Boolean.toString(((SwitchCompat) root.findViewById(R.id.saveButton)).isChecked()));
|
||||
return super.fillParams(root, activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActionText(OsmandApplication application) {
|
||||
String currentSource = application.getSettings().MAP_OVERLAY.get() == null ? KEY_NO_OVERLAY
|
||||
: application.getSettings().MAP_OVERLAY.get();
|
||||
|
||||
return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
|
|||
OsmandSettings settings = activity.getMyApplication().getSettings();
|
||||
List<Pair<String, String>> sources = loadListFromParams();
|
||||
if (sources.size() > 0) {
|
||||
boolean showBottomSheetStyles = Boolean.valueOf(getParams().get(KEY_DIALOG));
|
||||
boolean showBottomSheetStyles = Boolean.parseBoolean(getParams().get(KEY_DIALOG));
|
||||
if (showBottomSheetStyles) {
|
||||
showChooseDialog(activity.getSupportFragmentManager());
|
||||
return;
|
||||
|
@ -214,4 +214,13 @@ public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
|
|||
getParams().put(KEY_DIALOG, Boolean.toString(((SwitchCompat) root.findViewById(R.id.saveButton)).isChecked()));
|
||||
return super.fillParams(root, activity);
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,4 +226,12 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
getParams().put(KEY_DIALOG, Boolean.toString(((SwitchCompat) root.findViewById(R.id.saveButton)).isChecked()));
|
||||
return super.fillParams(root, activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActionText(OsmandApplication application) {
|
||||
String currentSource = application.getSettings().MAP_UNDERLAY.get() == null ? KEY_NO_UNDERLAY
|
||||
: application.getSettings().MAP_UNDERLAY.get();
|
||||
|
||||
return application.getString(R.string.map_quick_action_pattern, getTranslatedItemName(application, currentSource));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue