From bcbb6f97db2bc560305283c2291b828b2e372bb9 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 9 Nov 2011 16:58:36 +0100 Subject: Use GeopointFormatter instead of String.format when coordinates are around Some predefined formats have been added to fill the needs. This closes issue #769. --- main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'main/src/cgeo/geocaching/apps/cache/navi') diff --git a/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java b/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java index cb0b520..bc88853 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java @@ -6,13 +6,13 @@ import cgeo.geocaching.cgGeo; import cgeo.geocaching.cgSearch; import cgeo.geocaching.cgWaypoint; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.geopoint.GeopointFormatter.Format; import android.app.Activity; import android.content.Intent; import android.content.res.Resources; import java.util.ArrayList; -import java.util.Locale; class RMapsApp extends AbstractNavigationApp { @@ -34,20 +34,12 @@ class RMapsApp extends AbstractNavigationApp { if (isInstalled(activity)) { final ArrayList locations = new ArrayList(); if (cache != null && cache.getCoords() != null) { - locations.add(String.format((Locale) null, "%.6f", - cache.getCoords().getLatitude()) - + "," - + String.format((Locale) null, "%.6f", - cache.getCoords().getLongitude()) + locations.add(cache.getCoords().format(Format.LAT_LON_DECDEGREE_COMMA) + ";" + cache.getGeocode() + ";" + cache.getName()); } else if (waypoint != null && waypoint.getCoords() != null) { - locations.add(String.format((Locale) null, "%.6f", - waypoint.getCoords().getLatitude()) - + "," - + String.format((Locale) null, "%.6f", - waypoint.getCoords().getLongitude()) + locations.add(waypoint.getCoords().format(Format.LAT_LON_DECDEGREE_COMMA) + ";" + waypoint.getLookup() + ";" + waypoint.getName()); -- cgit v1.1