diff options
| author | Sven Karsten Greiner <sven@sammyshp.de> | 2011-09-13 00:21:14 -0700 |
|---|---|---|
| committer | Sven Karsten Greiner <sven@sammyshp.de> | 2011-09-13 00:21:14 -0700 |
| commit | 0dab75878492f23f345cf70fba70416a14436471 (patch) | |
| tree | 67cacdacde22e00281ad5f458fd8b05d3d5ad161 /src/cgeo/geocaching/cgDistanceView.java | |
| parent | 72bc9f6022e44d4c82407def9a1c81cf3c1d3a6b (diff) | |
| parent | affa2dd88d7080ba85edecf20d8e683567cf5fa4 (diff) | |
| download | cgeo-0dab75878492f23f345cf70fba70416a14436471.zip cgeo-0dab75878492f23f345cf70fba70416a14436471.tar.gz cgeo-0dab75878492f23f345cf70fba70416a14436471.tar.bz2 | |
Merge pull request #427 from samueltardieu/inline-operations
Inline operations regarding Geopoint
Diffstat (limited to 'src/cgeo/geocaching/cgDistanceView.java')
| -rw-r--r-- | src/cgeo/geocaching/cgDistanceView.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cgeo/geocaching/cgDistanceView.java b/src/cgeo/geocaching/cgDistanceView.java index ae9e7b7..9030bbb 100644 --- a/src/cgeo/geocaching/cgDistanceView.java +++ b/src/cgeo/geocaching/cgDistanceView.java @@ -27,14 +27,13 @@ public class cgDistanceView extends TextView { } public void update(final Geopoint coords) { - if (cacheCoords == null) return; - if (coords == null) return; - if (base == null) return; - - setText(base.getHumanDistance(cgBase.getDistance(coords, cacheCoords))); + if (cacheCoords == null || coords == null || base == null) { + return; + } + setText(base.getHumanDistance(coords.distanceTo(cacheCoords))); } - public void setDistance(Double distance) { + public void setDistance(Float distance) { setText("~" + base.getHumanDistance(distance)); } |
