From 9c421464df8565a0e1b8abc922a26a6eab44f315 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 21 May 2020 16:45:57 +0300 Subject: [PATCH] Add check for first state update --- OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java index e9b64b29ce..20a2cd3712 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java @@ -74,7 +74,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe private boolean isLayerOn; private boolean nightMode; - private boolean currentWidgetState; + private Boolean currentWidgetState; public MapQuickActionLayer(MapActivity activity, ContextMenuLayer contextMenuLayer) { this.mapActivity = activity; @@ -210,7 +210,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe */ public boolean setLayerState(boolean showWidget) { // check if state change is needed - if (currentWidgetState == showWidget) { + if (currentWidgetState != null && currentWidgetState == showWidget) { return false; } currentWidgetState = showWidget;