From 1aa0a026f8828ec3f9f97d8715ea81ef81094734 Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 3 Jan 2015 14:28:33 +0100 Subject: [PATCH] limit arrow update on dashboard to >3 degrees --- .../net/osmand/plus/dashboard/DashFavoritesFragment.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java index 388dcb825d..8b3cf4b369 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java @@ -180,8 +180,15 @@ public class DashFavoritesFragment extends DashBaseFragment { } public void updateCompassValue(float value) { + //heading = value; + //updateArrows(); + float lastHeading = heading; heading = value; - updateArrows(); + if (heading != null && lastHeading != null && Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 3) { + updateArrows(); + } else { + heading = lastHeading + } } public void updateLocation(Location location) {