Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-03-21 12:51:27 +01:00
commit d5b01e02c5
2 changed files with 26 additions and 4 deletions

View file

@ -9,6 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="no_overlay">No overlay</string>
<string name="no_underlay">No underlay</string>
<string name="subscribe_email_error">Error</string>
<string name="subscribe_email_desc">Subscribe to our email list about app discounts and get 3 more map downloads!</string>
<string name="depth_contour_descr">Set of maps allows you to see sea depth contour lines.</string>

View file

@ -2175,6 +2175,7 @@ public class QuickActionFactory {
public static final int TYPE = 15;
private final static String KEY_OVERLAYS = "overlays";
private final static String KEY_NO_OVERLAY = "no_overlay";
protected MapOverlayAction() {
super(TYPE);
@ -2238,8 +2239,14 @@ public class QuickActionFactory {
nextSource = sources.get(index + 1);
}
settings.MAP_OVERLAY.set(nextSource.first);
settings.MAP_OVERLAY_PREVIOUS.set(nextSource.first);
boolean hasOverlay = !nextSource.first.equals(KEY_NO_OVERLAY);
if (hasOverlay) {
settings.MAP_OVERLAY.set(nextSource.first);
settings.MAP_OVERLAY_PREVIOUS.set(nextSource.first);
} else {
settings.MAP_OVERLAY.set(null);
settings.MAP_OVERLAY_PREVIOUS.set(null);
}
plugin.updateMapLayers(activity.getMapView(), settings.MAP_OVERLAY, activity.getMapLayers());
Toast.makeText(activity, activity.getString(R.string.quick_action_map_overlay_switch, nextSource.second), Toast.LENGTH_SHORT).show();
@ -2274,6 +2281,7 @@ public class QuickActionFactory {
final OsmandSettings settings = activity.getMyApplication().getSettings();
Map<String, String> entriesMap = settings.getTileSourceEntries();
entriesMap.put(KEY_NO_OVERLAY, activity.getString(R.string.no_overlay));
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
final ArrayList<String> keys = new ArrayList<>(entriesMap.keySet());
final String[] items = new String[entriesMap.size()];
@ -2310,6 +2318,7 @@ public class QuickActionFactory {
public static final int TYPE = 16;
private final static String KEY_UNDERLAYS = "underlays";
private final static String KEY_NO_UNDERLAY = "no_underlay";
protected MapUnderlayAction() {
super(TYPE);
@ -2372,8 +2381,18 @@ public class QuickActionFactory {
nextSource = sources.get(index + 1);
}
settings.MAP_UNDERLAY.set(nextSource.first);
settings.MAP_UNDERLAY_PREVIOUS.set(nextSource.first);
boolean hasUnderlay = !nextSource.first.equals(KEY_NO_UNDERLAY);
if (hasUnderlay) {
settings.MAP_UNDERLAY.set(nextSource.first);
settings.MAP_UNDERLAY_PREVIOUS.set(nextSource.first);
} else {
settings.MAP_UNDERLAY.set(null);
settings.MAP_UNDERLAY_PREVIOUS.set(null);
}
final OsmandSettings.CommonPreference<Boolean> hidePolygonsPref =
activity.getMyApplication().getSettings().getCustomRenderBooleanProperty("noPolygons");
hidePolygonsPref.set(hasUnderlay);
plugin.updateMapLayers(activity.getMapView(), settings.MAP_UNDERLAY, activity.getMapLayers());
Toast.makeText(activity, activity.getString(R.string.quick_action_map_underlay_switch, nextSource.second), Toast.LENGTH_SHORT).show();
@ -2408,6 +2427,7 @@ public class QuickActionFactory {
final OsmandSettings settings = activity.getMyApplication().getSettings();
Map<String, String> entriesMap = settings.getTileSourceEntries();
entriesMap.put(KEY_NO_UNDERLAY, activity.getString(R.string.no_underlay));
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
final ArrayList<String> keys = new ArrayList<>(entriesMap.keySet());
final String[] items = new String[entriesMap.size()];