Merge pull request #11145 from osmandapp/Fix_9858

Fix #9858
This commit is contained in:
Vitaliy 2021-03-15 12:19:47 +02:00 committed by GitHub
commit 9f2da9598a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View file

@ -40,6 +40,7 @@ public class AnimateDraggingMapThread {
private double targetFloatZoom = 0;
private boolean isAnimatingZoom;
private boolean isAnimatingMapMove;
public AnimateDraggingMapThread(OsmandMapTileView tileView) {
this.tileView = tileView;
@ -158,6 +159,7 @@ public class AnimateDraggingMapThread {
@Override
public void run() {
isAnimatingMapMove = true;
setTargetValues(zoom, zoomFP, finalLat, finalLon);
boolean animateZoom = finalZoom != null && (zoom != startZoom || startZoomFP != 0);
@ -171,6 +173,7 @@ public class AnimateDraggingMapThread {
}
animatingMoveInThread(mMoveX, mMoveY, NAV_ANIMATION_TIME, notifyListener, null);
isAnimatingMapMove = false;
}
});
}
@ -217,6 +220,7 @@ public class AnimateDraggingMapThread {
@Override
public void run() {
isAnimatingMapMove = true;
setTargetValues(endZoom, 0, finalLat, finalLon);
if (moveZoom != startZoom) {
@ -243,6 +247,7 @@ public class AnimateDraggingMapThread {
tileView.setFractionalZoom(endZoom, 0, notifyListener);
pendingRotateAnimation();
isAnimatingMapMove = false;
}
});
}
@ -373,6 +378,10 @@ public class AnimateDraggingMapThread {
return isAnimatingZoom;
}
public boolean isAnimatingMapMove() {
return isAnimatingMapMove;
}
public void startZooming(final int zoomEnd, final double zoomPart, final boolean notifyListener) {
boolean doNotUseAnimations = tileView.getSettings().DO_NOT_USE_ANIMATIONS.get();
final float animationTime = doNotUseAnimations ? 0 : ZOOM_ANIMATION_TIME;

View file

@ -727,6 +727,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
return animatedDraggingThread.isAnimatingZoom();
}
public boolean isAnimatingMapMove() {
return animatedDraggingThread.isAnimatingMapMove();
}
@SuppressLint("WrongCall")
public void drawOverMap(Canvas canvas, RotatedTileBox tileBox, DrawSettings drawSettings) {
if (mapRenderer == null) {

View file

@ -253,7 +253,9 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
lastCheckMapZoom = zoom;
if (app.getSettings().SHOW_DOWNLOAD_MAP_DIALOG.get()
&& zoom >= ZOOM_MIN_TO_SHOW_DOWNLOAD_DIALOG && zoom <= ZOOM_MAX_TO_SHOW_DOWNLOAD_DIALOG
&& zoom >= ZOOM_MIN_TO_SHOW_DOWNLOAD_DIALOG
&& zoom <= ZOOM_MAX_TO_SHOW_DOWNLOAD_DIALOG
&& !view.isAnimatingMapMove()
&& currentObjects != null) {
Map<WorldRegion, BinaryMapDataObject> selectedObjects = new LinkedHashMap<>();