diff options
| -rw-r--r-- | main/src/cgeo/geocaching/cgGeo.java | 1 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/cgUser.java | 13 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/go4cache/Go4Cache.java (renamed from main/src/cgeo/geocaching/Go4Cache.java) | 41 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/go4cache/Go4CacheUser.java | 91 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 14 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/OtherCachersOverlay.java | 41 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/google/GoogleMapFactory.java | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/google/GoogleOtherCachersOverlayItem.java | 12 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/interfaces/MapFactory.java | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/interfaces/OtherCachersOverlayItemImpl.java | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapFactory.java | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/mapsforge/MapsforgeOtherCachersOverlayItem.java | 12 |
12 files changed, 148 insertions, 93 deletions
diff --git a/main/src/cgeo/geocaching/cgGeo.java b/main/src/cgeo/geocaching/cgGeo.java index 180a7a4..ebd6525 100644 --- a/main/src/cgeo/geocaching/cgGeo.java +++ b/main/src/cgeo/geocaching/cgGeo.java @@ -1,6 +1,7 @@ package cgeo.geocaching; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.go4cache.Go4Cache; import android.content.Context; import android.content.SharedPreferences; diff --git a/main/src/cgeo/geocaching/cgUser.java b/main/src/cgeo/geocaching/cgUser.java deleted file mode 100644 index 2249133..0000000 --- a/main/src/cgeo/geocaching/cgUser.java +++ /dev/null @@ -1,13 +0,0 @@ -package cgeo.geocaching; - -import cgeo.geocaching.geopoint.Geopoint; - -import java.util.Date; - -public class cgUser { - public Date located = null; - public String username = null; - public Geopoint coords = null; - public String action = null; - public String client = null; -} diff --git a/main/src/cgeo/geocaching/Go4Cache.java b/main/src/cgeo/geocaching/go4cache/Go4Cache.java index d2ed032..ffd5974 100644 --- a/main/src/cgeo/geocaching/Go4Cache.java +++ b/main/src/cgeo/geocaching/go4cache/Go4Cache.java @@ -1,5 +1,9 @@ -package cgeo.geocaching; +package cgeo.geocaching.go4cache; +import cgeo.geocaching.Parameters; +import cgeo.geocaching.Settings; +import cgeo.geocaching.cgBase; +import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.geopoint.GeopointFormatter.Format; import cgeo.geocaching.geopoint.Viewport; @@ -15,6 +19,7 @@ import android.util.Log; import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.concurrent.ArrayBlockingQueue; @@ -35,7 +40,7 @@ public class Go4Cache extends Thread { final private cgBase base; private static Go4Cache getInstance(final cgeoapplication app) { - if (instance == null) { + if (null == instance) { synchronized(Go4Cache.class) { instance = new Go4Cache(app); instance.start(); @@ -45,6 +50,7 @@ public class Go4Cache extends Thread { } private Go4Cache(final cgeoapplication app) { + super("Go4Cache"); this.app = app; base = cgBase.getInstance(app); setPriority(Thread.MIN_PRIORITY); @@ -77,7 +83,7 @@ public class Go4Cache extends Thread { // If we are too close and we haven't changed our current action, no need // to update our situation. - if (latestCoords != null && latestCoords.distanceTo(currentCoords) < 0.75 && StringUtils.equals(latestAction, currentAction)) { + if (null != latestCoords && latestCoords.distanceTo(currentCoords) < 0.75 && StringUtils.equals(latestAction, currentAction)) { continue; } @@ -94,13 +100,13 @@ public class Go4Cache extends Thread { "ln", lonStr, "a", currentAction, "s", (CryptUtils.sha1(username + "|" + latStr + "|" + lonStr + "|" + currentAction + "|" + CryptUtils.md5("carnero: developing your dreams"))).toLowerCase()); - if (base.version != null) { + if (null != base.version) { params.put("v", base.version); } cgBase.postRequest("http://api.go4cache.com/", params); - // Update our coordinates even if the request was not succesful, as not to hammer the server + // Update our coordinates even if the request was not successful, as not to hammer the server // with invalid requests for every new GPS position. latestCoords = currentCoords; latestAction = currentAction; @@ -119,10 +125,10 @@ public class Go4Cache extends Thread { * the current viewport * @return the list of users present in the viewport */ - public static List<cgUser> getGeocachersInViewport(final String username, final Viewport viewport) { - final List<cgUser> users = new ArrayList<cgUser>(); + public static List<Go4CacheUser> getGeocachersInViewport(final String username, final Viewport viewport) { + final List<Go4CacheUser> users = new ArrayList<Go4CacheUser>(); - if (username == null) { + if (null == username) { return users; } @@ -157,7 +163,7 @@ public class Go4Cache extends Thread { /** * Parse user information from go4cache.com. * - * @param oneUser + * @param user * a JSON object * @return a cgCache user filled with information * @throws JSONException @@ -165,14 +171,13 @@ public class Go4Cache extends Thread { * @throws ParseException * if the date could not be parsed as expected */ - private static cgUser parseUser(final JSONObject oneUser) throws JSONException, ParseException { - final cgUser user = new cgUser(); - final String located = oneUser.getString("located"); - user.located = cgBase.dateSqlIn.parse(located); - user.username = oneUser.getString("user"); - user.coords = new Geopoint(oneUser.getDouble("latitude"), oneUser.getDouble("longitude")); - user.action = oneUser.getString("action"); - user.client = oneUser.getString("client"); - return user; + private static Go4CacheUser parseUser(final JSONObject user) throws JSONException, ParseException { + final String located = user.getString("located"); + final Date userlocated = cgBase.dateSqlIn.parse(located); + final String username = user.getString("user"); + final Geopoint coords = new Geopoint(user.getDouble("latitude"), user.getDouble("longitude")); + final String action = user.getString("action"); + final String client = user.getString("client"); + return new Go4CacheUser(username, coords, userlocated, action, client); } } diff --git a/main/src/cgeo/geocaching/go4cache/Go4CacheUser.java b/main/src/cgeo/geocaching/go4cache/Go4CacheUser.java new file mode 100644 index 0000000..931bdaf --- /dev/null +++ b/main/src/cgeo/geocaching/go4cache/Go4CacheUser.java @@ -0,0 +1,91 @@ +package cgeo.geocaching.go4cache; + +import cgeo.geocaching.R; +import cgeo.geocaching.geopoint.Geopoint; + +import java.util.Date; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Go4CacheUser { + private static final Pattern patternGeocode = Pattern.compile("^(GC[A-Z0-9]+)(\\: ?(.+))?$", Pattern.CASE_INSENSITIVE); + + private final Date located; + private final String username; + private final Geopoint coords; + private final String action; + private final String client; + + private String actionForDisplay; + private String geocode; + + public Go4CacheUser(final String username, final Geopoint coords, final Date located, final String action, final String client) { + this.username = username; + this.coords = coords; + this.located = located; + this.action = action; + this.client = client; + } + + public Date getLocated() { + return located; + } + + public String getUsername() { + return username; + } + + public Geopoint getCoords() { + return coords; + } + + public int getIconId() { + if (null == client) { + return -1; + } + if (client.equalsIgnoreCase("c:geo")) { + return R.drawable.client_cgeo; + } else if (client.equalsIgnoreCase("preCaching")) { + return R.drawable.client_precaching; + } else if (client.equalsIgnoreCase("Handy Geocaching")) { + return R.drawable.client_handygeocaching; + } + return -1; + } + + private void getGeocodeAndAction() { + final Matcher matcherGeocode = patternGeocode.matcher(action.trim()); + + geocode = ""; + if (0 == action.length() || action.equalsIgnoreCase("pending")) { + actionForDisplay = "Looking around"; + } else if (action.equalsIgnoreCase("tweeting")) { + actionForDisplay = "Tweeting"; + } else if (matcherGeocode.find()) { + if (null != matcherGeocode.group(1)) { + geocode = matcherGeocode.group(1).trim().toUpperCase(); + } + if (null != matcherGeocode.group(3)) { + actionForDisplay = "Heading to " + geocode + " (" + matcherGeocode.group(3).trim() + ")"; + } else { + actionForDisplay = "Heading to " + geocode; + } + } else { + actionForDisplay = action; + } + } + + public String getAction() { + if (null == actionForDisplay) { + getGeocodeAndAction(); + } + return actionForDisplay; + } + + public String getGeocode() { + if (null == geocode) { + getGeocodeAndAction(); + } + return geocode; + } +} diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 59fcf8c..f59ddf0 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -1,6 +1,5 @@ package cgeo.geocaching.maps; -import cgeo.geocaching.Go4Cache; import cgeo.geocaching.R; import cgeo.geocaching.Settings; import cgeo.geocaching.Settings.mapSourceEnum; @@ -12,7 +11,6 @@ import cgeo.geocaching.cgGeo; import cgeo.geocaching.cgSearch; import cgeo.geocaching.cgUpdateDir; import cgeo.geocaching.cgUpdateLoc; -import cgeo.geocaching.cgUser; import cgeo.geocaching.cgWaypoint; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.cgeocaches; @@ -22,6 +20,8 @@ import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.enumerations.WaypointType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.geopoint.Viewport; +import cgeo.geocaching.go4cache.Go4Cache; +import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import cgeo.geocaching.maps.interfaces.GeoPointImpl; import cgeo.geocaching.maps.interfaces.MapActivityImpl; @@ -156,7 +156,7 @@ public class CGeoMap extends AbstractMap implements OnDragListener, ViewFactory /** List of caches in the viewport */ private List<cgCache> caches = new ArrayList<cgCache>(); /** List of users in the viewport */ - private List<cgUser> users = new ArrayList<cgUser>(); + private List<Go4CacheUser> users = new ArrayList<Go4CacheUser>(); private List<cgCoord> coordinates = new ArrayList<cgCoord>(); // storing for offline private ProgressDialog waitDialog = null; @@ -1529,9 +1529,9 @@ public class CGeoMap extends AbstractMap implements OnDragListener, ViewFactory */ private class DisplayUsersThread extends DoThread { - private List<cgUser> users = null; + private List<Go4CacheUser> users = null; - public DisplayUsersThread(List<cgUser> usersIn, long centerLatIn, long centerLonIn, long spanLatIn, long spanLonIn) { + public DisplayUsersThread(List<Go4CacheUser> usersIn, long centerLatIn, long centerLonIn, long spanLatIn, long spanLonIn) { super(centerLatIn, centerLonIn, spanLatIn, spanLonIn); setName("Display Users"); users = usersIn; @@ -1553,12 +1553,12 @@ public class CGeoMap extends AbstractMap implements OnDragListener, ViewFactory int counter = 0; OtherCachersOverlayItemImpl item = null; - for (cgUser userOne : users) { + for (Go4CacheUser userOne : users) { if (stop) { return; } - if (userOne.coords == null) { + if (userOne.getCoords() == null) { continue; } diff --git a/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java b/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java index 33274ba..8498b29 100644 --- a/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java +++ b/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java @@ -1,9 +1,8 @@ package cgeo.geocaching.maps; -import cgeo.geocaching.R; import cgeo.geocaching.Settings; -import cgeo.geocaching.cgUser; import cgeo.geocaching.cgeodetail; +import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.ItemizedOverlayImpl; import cgeo.geocaching.maps.interfaces.MapProjectionImpl; import cgeo.geocaching.maps.interfaces.MapViewImpl; @@ -21,14 +20,11 @@ import android.util.Log; import java.util.ArrayList; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; public class OtherCachersOverlay extends AbstractItemizedOverlay { private List<OtherCachersOverlayItemImpl> items = new ArrayList<OtherCachersOverlayItemImpl>(); private Context context = null; - private final Pattern patternGeocode = Pattern.compile("^(GC[A-Z0-9]+)(\\: ?(.+))?$", Pattern.CASE_INSENSITIVE); public OtherCachersOverlay(ItemizedOverlayImpl ovlImplIn, Context contextIn) { super(ovlImplIn); @@ -71,45 +67,20 @@ public class OtherCachersOverlay extends AbstractItemizedOverlay { } final OtherCachersOverlayItemImpl item = items.get(index); - final cgUser user = item.getUser(); + final Go4CacheUser user = item.getUser(); // set action - String action = null; - String geocode = null; - final Matcher matcherGeocode = patternGeocode.matcher(user.action.trim()); - - if (user.action.length() == 0 || user.action.equalsIgnoreCase("pending")) { - action = "Looking around"; - } else if (user.action.equalsIgnoreCase("tweeting")) { - action = "Tweeting"; - } else if (matcherGeocode.find()) { - if (matcherGeocode.group(1) != null) { - geocode = matcherGeocode.group(1).trim().toUpperCase(); - } - if (matcherGeocode.group(3) != null) { - action = "Heading to " + geocode + " (" + matcherGeocode.group(3).trim() + ")"; - } else { - action = "Heading to " + geocode; - } - } else { - action = user.action; - } + String action = user.getAction(); + String geocode = user.getGeocode(); // set icon - int icon = -1; - if (user.client.equalsIgnoreCase("c:geo")) { - icon = R.drawable.client_cgeo; - } else if (user.client.equalsIgnoreCase("preCaching")) { - icon = R.drawable.client_precaching; - } else if (user.client.equalsIgnoreCase("Handy Geocaching")) { - icon = R.drawable.client_handygeocaching; - } + int icon = user.getIconId(); final AlertDialog.Builder dialog = new AlertDialog.Builder(context); if (icon > -1) { dialog.setIcon(icon); } - dialog.setTitle(user.username); + dialog.setTitle(user.getUsername()); dialog.setMessage(action); dialog.setCancelable(true); if (StringUtils.isNotBlank(geocode)) { diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapFactory.java b/main/src/cgeo/geocaching/maps/google/GoogleMapFactory.java index 55f6837..d4ac68b 100644 --- a/main/src/cgeo/geocaching/maps/google/GoogleMapFactory.java +++ b/main/src/cgeo/geocaching/maps/google/GoogleMapFactory.java @@ -2,9 +2,9 @@ package cgeo.geocaching.maps.google; import cgeo.geocaching.R; import cgeo.geocaching.cgCoord; -import cgeo.geocaching.cgUser; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import cgeo.geocaching.maps.interfaces.GeoPointImpl; import cgeo.geocaching.maps.interfaces.MapFactory; @@ -43,7 +43,7 @@ public class GoogleMapFactory implements MapFactory { } @Override - public OtherCachersOverlayItemImpl getOtherCachersOverlayItemBase(Context context, cgUser userOne) { + public OtherCachersOverlayItemImpl getOtherCachersOverlayItemBase(Context context, Go4CacheUser userOne) { GoogleOtherCachersOverlayItem baseItem = new GoogleOtherCachersOverlayItem(context, userOne); return baseItem; } diff --git a/main/src/cgeo/geocaching/maps/google/GoogleOtherCachersOverlayItem.java b/main/src/cgeo/geocaching/maps/google/GoogleOtherCachersOverlayItem.java index f6fbcec..ac8e725 100644 --- a/main/src/cgeo/geocaching/maps/google/GoogleOtherCachersOverlayItem.java +++ b/main/src/cgeo/geocaching/maps/google/GoogleOtherCachersOverlayItem.java @@ -1,7 +1,7 @@ package cgeo.geocaching.maps.google; import cgeo.geocaching.R; -import cgeo.geocaching.cgUser; +import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.OtherCachersOverlayItemImpl; import com.google.android.maps.GeoPoint; @@ -12,10 +12,10 @@ import android.graphics.drawable.Drawable; public class GoogleOtherCachersOverlayItem extends OverlayItem implements OtherCachersOverlayItemImpl { private Context context = null; - private cgUser user = null; + private Go4CacheUser user = null; - public GoogleOtherCachersOverlayItem(Context contextIn, cgUser userIn) { - super(new GeoPoint(userIn.coords.getLatitudeE6(), userIn.coords.getLongitudeE6()), userIn.username, ""); + public GoogleOtherCachersOverlayItem(Context contextIn, Go4CacheUser userIn) { + super(new GeoPoint(userIn.getCoords().getLatitudeE6(), userIn.getCoords().getLongitudeE6()), userIn.getUsername(), ""); context = contextIn; user = userIn; @@ -25,7 +25,7 @@ public class GoogleOtherCachersOverlayItem extends OverlayItem implements OtherC public Drawable getMarker(int state) { Drawable marker = null; - if (user != null && user.located != null && user.located.getTime() >= (System.currentTimeMillis() - (20 * 60 * 1000))) { + if (user != null && user.getLocated() != null && user.getLocated().getTime() >= (System.currentTimeMillis() - (20 * 60 * 1000))) { marker = context.getResources().getDrawable(R.drawable.user_location_active); } else { marker = context.getResources().getDrawable(R.drawable.user_location); @@ -38,7 +38,7 @@ public class GoogleOtherCachersOverlayItem extends OverlayItem implements OtherC return marker; } - public cgUser getUser() { + public Go4CacheUser getUser() { return user; } } diff --git a/main/src/cgeo/geocaching/maps/interfaces/MapFactory.java b/main/src/cgeo/geocaching/maps/interfaces/MapFactory.java index 814703c..3bc6b8f 100644 --- a/main/src/cgeo/geocaching/maps/interfaces/MapFactory.java +++ b/main/src/cgeo/geocaching/maps/interfaces/MapFactory.java @@ -1,9 +1,9 @@ package cgeo.geocaching.maps.interfaces; import cgeo.geocaching.cgCoord; -import cgeo.geocaching.cgUser; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.go4cache.Go4CacheUser; import android.app.Activity; import android.content.Context; @@ -28,6 +28,6 @@ public interface MapFactory { public CachesOverlayItemImpl getCachesOverlayItem(final cgCoord coordinate, final CacheType type); public OtherCachersOverlayItemImpl getOtherCachersOverlayItemBase(Context context, - cgUser userOne); + Go4CacheUser userOne); } diff --git a/main/src/cgeo/geocaching/maps/interfaces/OtherCachersOverlayItemImpl.java b/main/src/cgeo/geocaching/maps/interfaces/OtherCachersOverlayItemImpl.java index 43fc58e..cc611ed 100644 --- a/main/src/cgeo/geocaching/maps/interfaces/OtherCachersOverlayItemImpl.java +++ b/main/src/cgeo/geocaching/maps/interfaces/OtherCachersOverlayItemImpl.java @@ -1,6 +1,6 @@ package cgeo.geocaching.maps.interfaces; -import cgeo.geocaching.cgUser; +import cgeo.geocaching.go4cache.Go4CacheUser; /** * Common functions of the provider-specific @@ -11,5 +11,5 @@ import cgeo.geocaching.cgUser; */ public interface OtherCachersOverlayItemImpl extends OverlayItemImpl { - public cgUser getUser(); + public Go4CacheUser getUser(); } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapFactory.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapFactory.java index dabd91b..3499c1d 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapFactory.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapFactory.java @@ -2,9 +2,9 @@ package cgeo.geocaching.maps.mapsforge; import cgeo.geocaching.R; import cgeo.geocaching.cgCoord; -import cgeo.geocaching.cgUser; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import cgeo.geocaching.maps.interfaces.GeoPointImpl; import cgeo.geocaching.maps.interfaces.MapFactory; @@ -42,7 +42,7 @@ public class MapsforgeMapFactory implements MapFactory { } @Override - public OtherCachersOverlayItemImpl getOtherCachersOverlayItemBase(Context context, cgUser userOne) { + public OtherCachersOverlayItemImpl getOtherCachersOverlayItemBase(Context context, Go4CacheUser userOne) { MapsforgeOtherCachersOverlayItem baseItem = new MapsforgeOtherCachersOverlayItem(context, userOne); return baseItem; } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeOtherCachersOverlayItem.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeOtherCachersOverlayItem.java index 6a83c16..f2cae3a 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeOtherCachersOverlayItem.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeOtherCachersOverlayItem.java @@ -1,7 +1,7 @@ package cgeo.geocaching.maps.mapsforge; import cgeo.geocaching.R; -import cgeo.geocaching.cgUser; +import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.OtherCachersOverlayItemImpl; import org.mapsforge.android.maps.GeoPoint; @@ -12,10 +12,10 @@ import android.graphics.drawable.Drawable; public class MapsforgeOtherCachersOverlayItem extends OverlayItem implements OtherCachersOverlayItemImpl { private Context context = null; - private cgUser user = null; + private Go4CacheUser user = null; - public MapsforgeOtherCachersOverlayItem(Context contextIn, cgUser userIn) { - super(new GeoPoint(userIn.coords.getLatitudeE6(), userIn.coords.getLongitudeE6()), userIn.username, ""); + public MapsforgeOtherCachersOverlayItem(Context contextIn, Go4CacheUser userIn) { + super(new GeoPoint(userIn.getCoords().getLatitudeE6(), userIn.getCoords().getLongitudeE6()), userIn.getUsername(), ""); context = contextIn; user = userIn; @@ -25,7 +25,7 @@ public class MapsforgeOtherCachersOverlayItem extends OverlayItem implements Oth public Drawable getMarker(int state) { Drawable marker = null; - if (user != null && user.located != null && user.located.getTime() >= (System.currentTimeMillis() - (20 * 60 * 1000))) { + if (user != null && user.getLocated() != null && user.getLocated().getTime() >= (System.currentTimeMillis() - (20 * 60 * 1000))) { marker = context.getResources().getDrawable(R.drawable.user_location_active); } else { marker = context.getResources().getDrawable(R.drawable.user_location); @@ -38,7 +38,7 @@ public class MapsforgeOtherCachersOverlayItem extends OverlayItem implements Oth return marker; } - public cgUser getUser() { + public Go4CacheUser getUser() { return user; } } |
