diff options
| author | rsudev <rasch@munin-soft.de> | 2013-07-30 20:25:10 +0200 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2013-07-30 20:25:10 +0200 |
| commit | c432b921c08b453e752e13cc5ac9609884a965d4 (patch) | |
| tree | 13d475bdc0fa2c56b368dd89fc0c046b0d0a4759 /main | |
| parent | 13551c5996c5be31bc50cdb691c17d1ac3fa0392 (diff) | |
| download | cgeo-c432b921c08b453e752e13cc5ac9609884a965d4.zip cgeo-c432b921c08b453e752e13cc5ac9609884a965d4.tar.gz cgeo-c432b921c08b453e752e13cc5ac9609884a965d4.tar.bz2 | |
Fixes #2996, Compass TTS: Wrong direction in "GPS only" mode
Diffstat (limited to 'main')
| -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 |
