aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/cgDistanceView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgeo/geocaching/cgDistanceView.java')
-rw-r--r--src/cgeo/geocaching/cgDistanceView.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/cgeo/geocaching/cgDistanceView.java b/src/cgeo/geocaching/cgDistanceView.java
index 9610e4f..ae9e7b7 100644
--- a/src/cgeo/geocaching/cgDistanceView.java
+++ b/src/cgeo/geocaching/cgDistanceView.java
@@ -3,11 +3,11 @@ package cgeo.geocaching;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
+import cgeo.geocaching.geopoint.Geopoint;
public class cgDistanceView extends TextView {
private cgBase base = null;
- private Double cacheLat = null;
- private Double cacheLon = null;
+ private Geopoint cacheCoords = null;
public cgDistanceView(Context context) {
super(context);
@@ -21,18 +21,17 @@ public class cgDistanceView extends TextView {
super(context, attrs, defStyle);
}
- public void setContent(cgBase baseIn, Double cacheLatIn, Double cacheLonIn) {
+ public void setContent(cgBase baseIn, final Geopoint cacheCoordsIn) {
base = baseIn;
- cacheLat = cacheLatIn;
- cacheLon = cacheLonIn;
+ cacheCoords = cacheCoordsIn;
}
- public void update(Double latitude, Double longitude) {
- if (cacheLat == null || cacheLon == null) return;
- if (latitude == null || longitude == null) return;
+ public void update(final Geopoint coords) {
+ if (cacheCoords == null) return;
+ if (coords == null) return;
if (base == null) return;
- setText(base.getHumanDistance(cgBase.getDistance(latitude, longitude, cacheLat, cacheLon)));
+ setText(base.getHumanDistance(cgBase.getDistance(coords, cacheCoords)));
}
public void setDistance(Double distance) {