diff options
Diffstat (limited to 'src/cgeo/geocaching/cgCacheListAdapter.java')
| -rw-r--r-- | src/cgeo/geocaching/cgCacheListAdapter.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/cgeo/geocaching/cgCacheListAdapter.java b/src/cgeo/geocaching/cgCacheListAdapter.java index dec5bef..6dc63da 100644 --- a/src/cgeo/geocaching/cgCacheListAdapter.java +++ b/src/cgeo/geocaching/cgCacheListAdapter.java @@ -50,11 +50,10 @@ public class cgCacheListAdapter extends ArrayAdapter<cgCache> { private LayoutInflater inflater = null; private Activity activity = null; private cgBase base = null; - private DistanceComparator dstComparator = null; private CacheComparator statComparator = null; private boolean historic = false; private Geopoint coords = null; - private Double azimuth = Double.valueOf(0); + private float azimuth = 0; private long lastSort = 0L; private boolean sort = true; private int checked = 0; @@ -79,7 +78,6 @@ public class cgCacheListAdapter extends ArrayAdapter<cgCache> { settings = settingsIn; list = listIn; base = baseIn; - dstComparator = new DistanceComparator(); DisplayMetrics metrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); @@ -257,7 +255,7 @@ public class cgCacheListAdapter extends ArrayAdapter<cgCache> { return; } - dstComparator.setCoords(coordsIn); + final DistanceComparator dstComparator = new DistanceComparator(coordsIn); Collections.sort((List<cgCache>) list, dstComparator); } notifyDataSetChanged(); @@ -278,7 +276,7 @@ public class cgCacheListAdapter extends ArrayAdapter<cgCache> { if (statComparator != null) { Collections.sort((List<cgCache>) list, statComparator); } else { - dstComparator.setCoords(coordsIn); + final DistanceComparator dstComparator = new DistanceComparator(coordsIn); Collections.sort((List<cgCache>) list, dstComparator); } notifyDataSetChanged(); @@ -302,12 +300,12 @@ public class cgCacheListAdapter extends ArrayAdapter<cgCache> { } } - public void setActualHeading(Double azimuthIn) { - if (azimuthIn == null) { + public void setActualHeading(Float directionNow) { + if (directionNow == null) { return; } - azimuth = azimuthIn; + azimuth = directionNow; if (CollectionUtils.isNotEmpty(compasses)) { for (cgCompassMini compass : compasses) { |
