diff options
Diffstat (limited to 'src/cgeo/geocaching/cgeopoint.java')
| -rw-r--r-- | src/cgeo/geocaching/cgeopoint.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/cgeo/geocaching/cgeopoint.java b/src/cgeo/geocaching/cgeopoint.java index 907bc3d..dba015d 100644 --- a/src/cgeo/geocaching/cgeopoint.java +++ b/src/cgeo/geocaching/cgeopoint.java @@ -1,8 +1,8 @@ package cgeo.geocaching; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -292,7 +292,7 @@ public class cgeopoint extends AbstractActivity { super.onPrepareOptionsMenu(menu); try { - ArrayList<Double> coords = getDestination(); + List<Double> coords = getDestination(); if (coords != null && coords.get(0) != null && coords.get(1) != null) { menu.findItem(0).setVisible(true); @@ -316,7 +316,7 @@ public class cgeopoint extends AbstractActivity { public boolean onOptionsItemSelected(MenuItem item) { final int menuItem = item.getItemId(); - ArrayList<Double> coords = getDestination(); + List<Double> coords = getDestination(); if(coords != null && !coords.isEmpty()) { @@ -338,7 +338,8 @@ public class cgeopoint extends AbstractActivity { return NavigationAppFactory.onMenuItemSelected(item, geo, this, res, null, null, null, coords); } - private void addToHistory(ArrayList<Double> coords) { + private void addToHistory(List + <Double> coords) { // Add locations to history cgDestination loc = new cgDestination(); loc.setLatitude(coords.get(0)); @@ -415,7 +416,7 @@ public class cgeopoint extends AbstractActivity { } private void cachesAround() { - ArrayList<Double> coords = getDestination(); + List<Double> coords = getDestination(); if (coords == null || coords.get(0) == null || coords.get(1) == null) { showToast(res.getString(R.string.err_location_unknown)); @@ -475,8 +476,8 @@ public class cgeopoint extends AbstractActivity { } } - private ArrayList<Double> getDestination() { - ArrayList<Double> coords = new ArrayList<Double>(); + private List<Double> getDestination() { + List<Double> coords = new ArrayList<Double>(); Double latitude = null; Double longitude = null; @@ -493,8 +494,8 @@ public class cgeopoint extends AbstractActivity { if (StringUtils.isNotBlank(latText) && StringUtils.isNotBlank(lonText)) { // latitude & longitude - HashMap<String, Object> latParsed = cgBase.parseCoordinate(latText, "lat"); - HashMap<String, Object> lonParsed = cgBase.parseCoordinate(lonText, "lon"); + Map<String, Object> latParsed = cgBase.parseCoordinate(latText, "lat"); + Map<String, Object> lonParsed = cgBase.parseCoordinate(lonText, "lon"); if (latParsed == null || latParsed.get("coordinate") == null || latParsed.get("string") == null) { showToast(res.getString(R.string.err_parse_lat)); @@ -575,7 +576,7 @@ public class cgeopoint extends AbstractActivity { Double latParsed = null; Double lonParsed = null; - HashMap<String, Double> coordsDst = cgBase.getRadialDistance(latitude, longitude, bearing, distance); + Map<String, Double> coordsDst = cgBase.getRadialDistance(latitude, longitude, bearing, distance); latParsed = coordsDst.get("latitude"); lonParsed = coordsDst.get("longitude"); |
