From 640c3aa5e63e4baacac4e1737a529873a48f117d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 5 Aug 2015 00:07:00 +0200 Subject: [PATCH] Fix transparency --- .../src/net/osmand/plus/activities/MapActivityLayers.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 06f60ca866..cc010a5a55 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -78,6 +78,8 @@ public class MapActivityLayers { private MapControlsLayer mapControlsLayer; private DownloadedRegionsLayer downloadedRegionsLayer; private MapWidgetRegistry mapWidgetRegistry; + + private StateChangedListener transparencyListener; public MapActivityLayers(MapActivity activity) { this.activity = activity; @@ -150,14 +152,15 @@ public class MapActivityLayers { mapControlsLayer = new MapControlsLayer(activity); mapView.addLayer(mapControlsLayer, 11); - app.getSettings().MAP_TRANSPARENCY.addListener(new StateChangedListener() { + transparencyListener = new StateChangedListener() { @Override public void stateChanged(Integer change) { mapTileLayer.setAlpha(change); mapVectorLayer.setAlpha(change); mapView.refreshMap(); } - }); + }; + app.getSettings().MAP_TRANSPARENCY.addListener(transparencyListener); OsmandPlugin.createLayers(mapView, activity); app.getAppCustomization().createLayers(mapView, activity);