aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormucek4 <tomaz@gorenc.org>2011-07-20 12:02:14 +0200
committermucek4 <tomaz@gorenc.org>2011-07-20 12:02:14 +0200
commitca2c50e2f4ebc8074e3bf5ce25b69f74f464da48 (patch)
treed96548c1defc90c2082a650241b9016fcf48a50c /src
parent33271246f4352d976faa5a9c44079c87e3f81ca4 (diff)
downloadcgeo-ca2c50e2f4ebc8074e3bf5ce25b69f74f464da48.zip
cgeo-ca2c50e2f4ebc8074e3bf5ce25b69f74f464da48.tar.gz
cgeo-ca2c50e2f4ebc8074e3bf5ce25b69f74f464da48.tar.bz2
Added Eclipse project file, caches blinking on live map, blue arrow moving
Diffstat (limited to 'src')
-rw-r--r--src/cgeo/geocaching/cgeoabout.java6
-rw-r--r--src/cgeo/geocaching/mapcommon/cgeomap.java42
-rw-r--r--src/cgeo/geocaching/mapsforge/mfMapView.java14
3 files changed, 42 insertions, 20 deletions
diff --git a/src/cgeo/geocaching/cgeoabout.java b/src/cgeo/geocaching/cgeoabout.java
index fe11660..06ac46b 100644
--- a/src/cgeo/geocaching/cgeoabout.java
+++ b/src/cgeo/geocaching/cgeoabout.java
@@ -71,12 +71,14 @@ public class cgeoabout extends Activity {
}
public void donateMore(View view) {
- activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N2FKGNCPPRUVE")));
+ activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FMLNN8GXZKJEE")));
+ //activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N2FKGNCPPRUVE")));
//activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2Z69QWLRCBE9N&lc=US&item_name=c%3ageo&currency_code=EUR&amount=15&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted")));
}
public void donateLess(View view) {
- activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4PRD9CX4Y8XR6")));
+ activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FMLNN8GXZKJEE")));
+ //activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4PRD9CX4Y8XR6")));
//activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2Z69QWLRCBE9N&lc=US&item_name=c%3ageo&currency_code=EUR&amount=7&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted")));
}
diff --git a/src/cgeo/geocaching/mapcommon/cgeomap.java b/src/cgeo/geocaching/mapcommon/cgeomap.java
index a57d954..1910882 100644
--- a/src/cgeo/geocaching/mapcommon/cgeomap.java
+++ b/src/cgeo/geocaching/mapcommon/cgeomap.java
@@ -689,6 +689,9 @@ public class cgeomap extends MapBase {
if (geo.latitudeNow != null && geo.longitudeNow != null) {
if (followMyLocation == true) {
myLocationInMiddle();
+ } else {
+ // move blue arrow
+ mapView.invalidate();
}
}
@@ -977,10 +980,15 @@ public class cgeomap extends MapBase {
//2. fetch and draw(in another thread) and then insert into the db caches from geocaching.com - dont draw/insert if exist in memory?
// stage 1 - pull and render from the DB only
- if (!live || settings.maplive == 0) {
- searchId = app.getStoredInViewport(centerLat, centerLon, spanLat, spanLon, settings.cacheType);
- } else {
- searchId = app.getCachedInViewport(centerLat, centerLon, spanLat, spanLon, settings.cacheType);
+
+ if (fromDetailIntent) {
+ searchId = searchIdIntent;
+ } else {
+ if (!live || settings.maplive == 0) {
+ searchId = app.getStoredInViewport(centerLat, centerLon, spanLat, spanLon, settings.cacheType);
+ } else {
+ searchId = app.getCachedInViewport(centerLat, centerLon, spanLat, spanLon, settings.cacheType);
+ }
}
if (searchId != null) {
@@ -995,6 +1003,30 @@ public class cgeomap extends MapBase {
}
caches = app.getCaches(searchId);
+
+ //if in live map and stored caches are found / disables are also shown.
+ if (live && settings.maplive >= 1) {
+ // I know code is crude, but temporary fix
+ int i = 0;
+ boolean excludeMine = settings.excludeMine > 0;
+ boolean excludeDisabled = settings.excludeDisabled > 0;
+
+ while (i < caches.size())
+ {
+ boolean remove = false;
+ if ((caches.get(i).found) && (excludeMine))
+ remove = true;
+ if ((caches.get(i).own) && (excludeMine))
+ remove = true;
+ if ((caches.get(i).disabled) && (excludeDisabled))
+ remove = true;
+ if (remove)
+ caches.remove(i);
+ else
+ i++;
+ }
+
+ }
if (stop) {
displayHandler.sendEmptyMessage(0);
@@ -1171,7 +1203,7 @@ public class cgeomap extends MapBase {
if (cacheOne.latitude == null && cacheOne.longitude == null) {
continue;
}
-
+
final cgCoord coord = new cgCoord(cacheOne);
coordinates.add(coord);
diff --git a/src/cgeo/geocaching/mapsforge/mfMapView.java b/src/cgeo/geocaching/mapsforge/mfMapView.java
index e2908a5..67b0ed7 100644
--- a/src/cgeo/geocaching/mapsforge/mfMapView.java
+++ b/src/cgeo/geocaching/mapsforge/mfMapView.java
@@ -138,18 +138,6 @@ public class mfMapView extends MapView implements MapViewImpl {
setScaleBar(b);
}
- /**
- * Checks whether a given file is a valid map file.
- *
- * @param file
- * the path to the map file that should be tested.
- * @return true if the file is a valid map file, false otherwise.
- */
- public static boolean isValidMapFile(String file) {
- return MapDatabase.isValidMapFile(file);
- }
-
-
@Override
public void setMapSource(cgSettings settings) {
@@ -163,7 +151,7 @@ public class mfMapView extends MapView implements MapViewImpl {
setMapViewMode(MapViewMode.OSMARENDER_TILE_DOWNLOAD);
break;
case mapsforgeOffline:
- if (isValidMapFile(settings.getMapFile())) {
+ if (MapDatabase.isValidMapFile(settings.getMapFile())) {
setMapViewMode(MapViewMode.CANVAS_RENDERER);
super.setMapFile(settings.getMapFile());
}