package cgeo.geocaching.ui;

import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.Units;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

public class DistanceView extends TextView {
    private Geopoint cacheCoords = null;

    public DistanceView(Context context) {
        super(context);
    }

    public DistanceView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public DistanceView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setContent(final Geopoint cacheCoordsIn) {
        cacheCoords = cacheCoordsIn;
    }

    public void update(final Geopoint coords) {
        if (cacheCoords == null || coords == null) {
            return;
        }
        setText(Units.getDistanceFromKilometers(coords.distanceTo(cacheCoords)));
    }

    public void setDistance(Float distance) {
        setText("~" + Units.getDistanceFromKilometers(distance));
    }

    public void clear() {
        setText(null);
    }
}
@@ -1034,62 +1034,6 @@
    %7D
-%0A%0A    public void clear() %7B%0A        setText(null);%0A    %7D
 %0A%7D

remove unused method Clear()