From 341792b0db80d200ef80f8a3956440e1f8411a88 Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 29 Aug 2014 14:32:11 +0200 Subject: [PATCH] proper compass icon update upon rotation mode change --- .../plus/views/mapwidgets/MapInfoWidgetsFactory.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index 9784d82ea2..54356905ee 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -295,6 +295,7 @@ public class MapInfoWidgetsFactory { final int mh = (int) compass.getMinimumHeight() ; ImageViewWidget compassView = new ImageViewWidget(map) { private float cachedRotate = 0; + private int cachedRotateMap = 0; private boolean nm; @Override protected void onDraw(Canvas canvas) { @@ -323,6 +324,17 @@ public class MapInfoWidgetsFactory { invalidate(); return true; } + if(app.getSettings().ROTATE_MAP.get() != cachedRotateMap) { + cachedRotateMap = app.getSettings().ROTATE_MAP.get(); + if (app.getSettings().ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE) { + setImageDrawable(drawSettings.isNightMode() ? compassNiuWhite : compassNiu); + } else if (app.getSettings().ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) { + setImageDrawable(drawSettings.isNightMode() ? compassBearingWhite : compassBearing); + } else { + setImageDrawable(drawSettings.isNightMode() ? compassWhite : compass); + } + return true; + } return false; } };