From 1e8de2997f79fe21964fb66de47de9a65203904c Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Tue, 5 Mar 2019 17:49:01 +0200 Subject: [PATCH] Issue #6601 - Quickaction turning Underlay/Overlay map on/off and transparency seekbar --- .../osmand/plus/quickaction/actions/MapOverlayAction.java | 5 +++++ .../osmand/plus/quickaction/actions/MapUnderlayAction.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapOverlayAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapOverlayAction.java index 71f247cd8e..55a243d3dd 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapOverlayAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapOverlayAction.java @@ -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> { 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()); diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapUnderlayAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapUnderlayAction.java index 4964608e1f..a2a77f8072 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/MapUnderlayAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/MapUnderlayAction.java @@ -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> { 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 hidePolygonsPref = activity.getMyApplication().getSettings().getCustomRenderBooleanProperty("noPolygons");