limit arrow update on dashboard to >3 degrees

This commit is contained in:
sonora 2015-01-03 14:28:33 +01:00
parent 04d2a25c22
commit 1aa0a026f8

View file

@ -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) {