diff options
| author | Bananeweizen <Bananeweizen@gmx.de> | 2013-07-31 05:53:35 -0700 |
|---|---|---|
| committer | Bananeweizen <Bananeweizen@gmx.de> | 2013-07-31 05:53:35 -0700 |
| commit | 12fde50559c844312df90d05f77f45e4e98064d9 (patch) | |
| tree | 87b079ced2b136441ee876ed234a28222b66ef0f | |
| parent | 4a806d990a678e20a09c893f65c8cabff2aefbd5 (diff) | |
| parent | c432b921c08b453e752e13cc5ac9609884a965d4 (diff) | |
| download | cgeo-12fde50559c844312df90d05f77f45e4e98064d9.zip cgeo-12fde50559c844312df90d05f77f45e4e98064d9.tar.gz cgeo-12fde50559c844312df90d05f77f45e4e98064d9.tar.bz2 | |
Merge pull request #3084 from rsudev/issue2996
Fixes #2996, Compass TTS: Wrong direction in "GPS only" mode
| -rw-r--r-- | main/src/cgeo/geocaching/speech/SpeechService.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/speech/SpeechService.java b/main/src/cgeo/geocaching/speech/SpeechService.java index 634f1c4..ae289ed 100644 --- a/main/src/cgeo/geocaching/speech/SpeechService.java +++ b/main/src/cgeo/geocaching/speech/SpeechService.java @@ -1,8 +1,9 @@ package cgeo.geocaching.speech; import cgeo.geocaching.DirectionProvider; -import cgeo.geocaching.settings.Settings; +import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.settings.Settings; import cgeo.geocaching.utils.GeoDirHandler; import cgeo.geocaching.utils.Log; @@ -44,16 +45,18 @@ public class SpeechService extends Service implements OnInitListener { GeoDirHandler geoHandler = new GeoDirHandler() { @Override protected void updateDirection(float newDirection) { - direction = DirectionProvider.getDirectionNow(startingActivity, newDirection); - directionInitialized = true; - updateCompass(); + if (cgeoapplication.getInstance().currentGeo().getSpeed() <= 5) { + direction = DirectionProvider.getDirectionNow(startingActivity, newDirection); + directionInitialized = true; + updateCompass(); + } } @Override protected void updateGeoData(cgeo.geocaching.IGeoData newGeo) { position = newGeo.getCoords(); positionInitialized = true; - if (newGeo.getSpeed() > 5) { + if (!Settings.isUseCompass() || newGeo.getSpeed() > 5) { direction = newGeo.getBearing(); directionInitialized = true; } @@ -151,7 +154,11 @@ public class SpeechService extends Service implements OnInitListener { initialized = true; - geoHandler.startGeoAndDir(); + if (Settings.isUseCompass()) { + geoHandler.startGeoAndDir(); + } else { + geoHandler.startGeo(); + } } @Override |
