aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/cgCacheListAdapter.java
diff options
context:
space:
mode:
authorSven Karsten Greiner <sven@sammyshp.de>2011-09-13 00:21:14 -0700
committerSven Karsten Greiner <sven@sammyshp.de>2011-09-13 00:21:14 -0700
commit0dab75878492f23f345cf70fba70416a14436471 (patch)
tree67cacdacde22e00281ad5f458fd8b05d3d5ad161 /src/cgeo/geocaching/cgCacheListAdapter.java
parent72bc9f6022e44d4c82407def9a1c81cf3c1d3a6b (diff)
parentaffa2dd88d7080ba85edecf20d8e683567cf5fa4 (diff)
downloadcgeo-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/cgCacheListAdapter.java')
-rw-r--r--src/cgeo/geocaching/cgCacheListAdapter.java14
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) {