Created
February 10, 2019 17:26
-
-
Save rsudev/c013984060f350ba2dccfac2b9c04bf9 to your computer and use it in GitHub Desktop.
patch suggestion fro invalidateAll in new map (c:geo)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/AbstractCachesOverlay.java b/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/AbstractCachesOverlay.java | |
index fef98dc0f..4df04d697 100644 | |
--- a/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/AbstractCachesOverlay.java | |
+++ b/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/AbstractCachesOverlay.java | |
@@ -96,6 +96,11 @@ public abstract class AbstractCachesOverlay { | |
invalidate(); | |
} | |
+ public void invalidateAll() { | |
+ removeItems(getGeocodes()); | |
+ invalidate(); | |
+ } | |
+ | |
protected boolean isInvalidated() { | |
return invalidated; | |
} | |
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesBundle.java b/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesBundle.java | |
index dc8c30340..0baeb0b48 100644 | |
--- a/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesBundle.java | |
+++ b/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesBundle.java | |
@@ -213,6 +213,22 @@ public class CachesBundle { | |
} | |
} | |
+ /** | |
+ * Forces redraw of all cache layers (e.g. for icon change) | |
+ */ | |
+ public void invalidateAll() | |
+ { | |
+ if (baseOverlay != null) { | |
+ baseOverlay.invalidateAll(); | |
+ } | |
+ if (storedOverlay != null) { | |
+ storedOverlay.invalidateAll(); | |
+ } | |
+ if (liveOverlay != null) { | |
+ liveOverlay.invalidateAll(); | |
+ } | |
+ } | |
+ | |
public boolean isDownloading() { | |
return liveOverlay != null && liveOverlay.isDownloading(); | |
} | |
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesOverlay.java b/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesOverlay.java | |
index 9227a1553..91367c6b5 100644 | |
--- a/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesOverlay.java | |
+++ b/main/src/cgeo/geocaching/maps/mapsforge/v6/caches/CachesOverlay.java | |
@@ -104,6 +104,13 @@ public class CachesOverlay extends AbstractCachesOverlay { | |
} | |
} | |
+ @Override | |
+ public void invalidate() { | |
+ firstRun = true; | |
+ | |
+ super.invalidate(); | |
+ } | |
+ | |
@Override | |
public void onDestroy() { | |
timer.dispose(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment