Merge pull request #4366 from osmandapp/disable_animations

Disable anim in move and zoom
This commit is contained in:
Alexey 2017-08-30 16:38:14 +03:00 committed by GitHub
commit 26672bc1d7

View file

@ -212,8 +212,9 @@ public class AnimateDraggingMapThread {
}
final float mMoveX = rb.getPixXFromLatLon(startLat, startLon) - rb.getPixXFromLatLon(finalLat, finalLon);
final float mMoveY = rb.getPixYFromLatLon(startLat, startLon) - rb.getPixYFromLatLon(finalLat, finalLon);
final float animationTime = Math.max(450, (Math.abs(mStX) + Math.abs(mStY)) / 1200f * MOVE_MOVE_ANIMATION_TIME);
final boolean doNotUseAnimations = tileView.getSettings().DO_NOT_USE_ANIMATIONS.get();
final float animationTime = doNotUseAnimations ? 0 : Math.max(450, (Math.abs(mStX) + Math.abs(mStY)) / 1200f * MOVE_MOVE_ANIMATION_TIME);
startThreadAnimating(new Runnable() {
@ -221,7 +222,7 @@ public class AnimateDraggingMapThread {
public void run() {
setTargetValues(endZoom, finalLat, finalLon);
if(moveZoom != startZoom){
animatingZoomInThread(startZoom, startZoomFP, moveZoom, startZoomFP,ZOOM_MOVE_ANIMATION_TIME, notifyListener);
animatingZoomInThread(startZoom, startZoomFP, moveZoom, startZoomFP, doNotUseAnimations ? 0 : ZOOM_MOVE_ANIMATION_TIME, notifyListener);
}
if(!stopped){
@ -232,7 +233,7 @@ public class AnimateDraggingMapThread {
}
if (!stopped && (moveZoom != endZoom || startZoomFP != 0)) {
animatingZoomInThread(moveZoom, startZoomFP, endZoom, 0, ZOOM_MOVE_ANIMATION_TIME, notifyListener);
animatingZoomInThread(moveZoom, startZoomFP, endZoom, 0, doNotUseAnimations ? 0 : ZOOM_MOVE_ANIMATION_TIME, notifyListener);
}
tileView.setFractionalZoom(endZoom, 0, notifyListener);