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.java71
1 files changed, 36 insertions, 35 deletions
diff --git a/src/cgeo/geocaching/cgDistanceView.java b/src/cgeo/geocaching/cgDistanceView.java
index 9030bbb..ebdfe78 100644
--- a/src/cgeo/geocaching/cgDistanceView.java
+++ b/src/cgeo/geocaching/cgDistanceView.java
@@ -1,43 +1,44 @@
package cgeo.geocaching;
+import cgeo.geocaching.geopoint.Geopoint;
+
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 Geopoint cacheCoords = null;
-
- public cgDistanceView(Context context) {
- super(context);
- }
-
- public cgDistanceView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public cgDistanceView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- public void setContent(cgBase baseIn, final Geopoint cacheCoordsIn) {
- base = baseIn;
- cacheCoords = cacheCoordsIn;
- }
-
- public void update(final Geopoint coords) {
- if (cacheCoords == null || coords == null || base == null) {
- return;
- }
- setText(base.getHumanDistance(coords.distanceTo(cacheCoords)));
- }
-
- public void setDistance(Float distance) {
- setText("~" + base.getHumanDistance(distance));
- }
-
- public void clear() {
- setText(null);
- }
+ private cgBase base = null;
+ private Geopoint cacheCoords = null;
+
+ public cgDistanceView(Context context) {
+ super(context);
+ }
+
+ public cgDistanceView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public cgDistanceView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ public void setContent(cgBase baseIn, final Geopoint cacheCoordsIn) {
+ base = baseIn;
+ cacheCoords = cacheCoordsIn;
+ }
+
+ public void update(final Geopoint coords) {
+ if (cacheCoords == null || coords == null || base == null) {
+ return;
+ }
+ setText(base.getHumanDistance(coords.distanceTo(cacheCoords)));
+ }
+
+ public void setDistance(Float distance) {
+ setText("~" + base.getHumanDistance(distance));
+ }
+
+ public void clear() {
+ setText(null);
+ }
} \ No newline at end of file