fire new ANIM_START event when animation is started, do not fire again until all animations are done

This commit is contained in:
Stephan Leuschner 2016-08-10 00:03:48 -04:00 committed by Emux
parent 136c323a75
commit 67357fe2f0
2 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
/* /*
* Copyright 2013 Hannes Janetzek * Copyright 2013 Hannes Janetzek
* Copyright 2016 Stephan Leuschner
* *
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
* *
@ -193,6 +194,8 @@ public class Animator {
} }
private void animStart(float duration, int state) { private void animStart(float duration, int state) {
if (!isActive())
mMap.events.fire(Map.ANIM_START, mMap.mMapPosition);
mCurPos.copy(mStartPos); mCurPos.copy(mStartPos);
mState = state; mState = state;
mDuration = duration; mDuration = duration;

View File

@ -1,6 +1,7 @@
/* /*
* Copyright 2013 Hannes Janetzek * Copyright 2013 Hannes Janetzek
* Copyright 2016 Andrey Novikov * Copyright 2016 Andrey Novikov
* Copyright 2016 Stephan Leuschner
* *
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
* *
@ -92,6 +93,8 @@ public abstract class Map implements TaskQueue {
public static final Event ANIM_END = new Event(); public static final Event ANIM_END = new Event();
public static final Event ANIM_START = new Event();
public final EventDispatcher<InputListener, MotionEvent> input; public final EventDispatcher<InputListener, MotionEvent> input;
public final EventDispatcher<UpdateListener, MapPosition> events; public final EventDispatcher<UpdateListener, MapPosition> events;