Issue #6601 - Quickaction turning Underlay/Overlay map on/off and transparency seekbar

This commit is contained in:
madwasp79 2019-03-05 17:49:01 +02:00
parent b119f2f572
commit 1e8de2997f
2 changed files with 12 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import com.google.gson.reflect.TypeToken;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.LayerTransparencySeekbarMode;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.quickaction.QuickAction;
@ -120,8 +121,12 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
if (hasOverlay) {
settings.MAP_OVERLAY.set(params);
settings.MAP_OVERLAY_PREVIOUS.set(params);
if (settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == OsmandSettings.LayerTransparencySeekbarMode.OVERLAY) {
activity.getMapLayers().getMapControlsLayer().showTransparencyBar(settings.MAP_OVERLAY_TRANSPARENCY, true);
}
} else {
settings.MAP_OVERLAY.set(null);
activity.getMapLayers().getMapControlsLayer().hideTransparencyBar();
settings.MAP_OVERLAY_PREVIOUS.set(null);
}
plugin.updateMapLayers(activity.getMapView(), settings.MAP_OVERLAY, activity.getMapLayers());

View file

@ -14,6 +14,7 @@ import com.google.gson.reflect.TypeToken;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.LayerTransparencySeekbarMode;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.quickaction.QuickAction;
@ -118,9 +119,15 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
if (hasUnderlay) {
settings.MAP_UNDERLAY.set(params);
settings.MAP_UNDERLAY_PREVIOUS.set(params);
if (settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.UNDERLAY) {
activity.getMapLayers().getMapControlsLayer().showTransparencyBar(settings.MAP_TRANSPARENCY, true);
}
} else {
settings.MAP_UNDERLAY.set(null);
activity.getMapLayers().getMapControlsLayer().hideTransparencyBar();
settings.MAP_UNDERLAY_PREVIOUS.set(null);
}
final OsmandSettings.CommonPreference<Boolean> hidePolygonsPref =
activity.getMyApplication().getSettings().getCustomRenderBooleanProperty("noPolygons");