diff options
| author | Gerald Barker <geraldbarker@gmail.com> | 2011-09-02 23:19:51 +0100 |
|---|---|---|
| committer | Gerald Barker <geraldbarker@gmail.com> | 2011-09-02 23:19:51 +0100 |
| commit | 53936c7ee6654a525075b03e1b4c8ddbfbcd4ef5 (patch) | |
| tree | 41154be6daecad1b4483223d72920e0a290024ef /src/cgeo/geocaching/StaticMapsProvider.java | |
| parent | afbe8c5164e1157e38e0f8c4b28942cbd9fe3d41 (diff) | |
| download | cgeo-53936c7ee6654a525075b03e1b4c8ddbfbcd4ef5.zip cgeo-53936c7ee6654a525075b03e1b4c8ddbfbcd4ef5.tar.gz cgeo-53936c7ee6654a525075b03e1b4c8ddbfbcd4ef5.tar.bz2 | |
First commit of Apache Commons String & Date functions and required, and
refactor of code to use them.
Diffstat (limited to 'src/cgeo/geocaching/StaticMapsProvider.java')
| -rw-r--r-- | src/cgeo/geocaching/StaticMapsProvider.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cgeo/geocaching/StaticMapsProvider.java b/src/cgeo/geocaching/StaticMapsProvider.java index b649f7b..cac5118 100644 --- a/src/cgeo/geocaching/StaticMapsProvider.java +++ b/src/cgeo/geocaching/StaticMapsProvider.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Locale; +import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; @@ -18,6 +19,7 @@ import android.content.Context; import android.util.Log; import android.view.Display; import android.view.WindowManager; +import cgeo.geocaching.utils.CollectionUtils; public class StaticMapsProvider { private static final String MARKERS_URL = "http://cgeo.carnero.cc/_markers/"; @@ -122,7 +124,7 @@ public class StaticMapsProvider { public static void downloadMaps(cgCache cache, cgSettings settings, Activity activity) { if (settings.storeOfflineMaps != 1 || cache.latitude == null - || cache.longitude == null || cache.geocode == null || cache.geocode.length() == 0) { + || cache.longitude == null || StringUtils.isNotBlank(cache.geocode)) { return; } @@ -138,7 +140,7 @@ public class StaticMapsProvider { } final StringBuilder waypoints = new StringBuilder(); - if (cache.waypoints != null && cache.waypoints.size() > 0) { + if (CollectionUtils.isNotEmpty(cache.waypoints)) { for (cgWaypoint waypoint : cache.waypoints) { if (waypoint.latitude == null && waypoint.longitude == null) { continue; |
