Animator: animation end event
This commit is contained in:
parent
8626aa2f53
commit
dfc1aeb98f
@ -211,11 +211,8 @@ public class Animator {
|
|||||||
|
|
||||||
long millisLeft = mAnimEnd - MapRenderer.frametime;
|
long millisLeft = mAnimEnd - MapRenderer.frametime;
|
||||||
|
|
||||||
//boolean changed = false;
|
|
||||||
|
|
||||||
ViewController v = mMap.viewport();
|
ViewController v = mMap.viewport();
|
||||||
|
|
||||||
//synchronized (v) {
|
|
||||||
/* cancel animation when position was changed since last
|
/* cancel animation when position was changed since last
|
||||||
* update, i.e. when it was modified outside the animator. */
|
* update, i.e. when it was modified outside the animator. */
|
||||||
if (v.getMapPosition(mCurPos)) {
|
if (v.getMapPosition(mCurPos)) {
|
||||||
@ -293,5 +290,10 @@ public class Animator {
|
|||||||
mState = ANIM_NONE;
|
mState = ANIM_NONE;
|
||||||
mPivot.x = 0;
|
mPivot.x = 0;
|
||||||
mPivot.y = 0;
|
mPivot.y = 0;
|
||||||
|
mMap.events.fire(Map.ANIM_END, mMap.mMapPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActive() {
|
||||||
|
return mState != ANIM_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,30 +66,33 @@ public abstract class Map implements TaskQueue {
|
|||||||
/**
|
/**
|
||||||
* UpdateListener event. Map position has changed.
|
* UpdateListener event. Map position has changed.
|
||||||
*/
|
*/
|
||||||
public static Event POSITION_EVENT = new Event();
|
public static final Event POSITION_EVENT = new Event();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateLister event. Delivered on main-thread when updateMap() was called
|
* UpdateLister event. Delivered on main-thread when updateMap() was called
|
||||||
* and no CLEAR_EVENT or POSITION_EVENT was triggered.
|
* and no CLEAR_EVENT or POSITION_EVENT was triggered.
|
||||||
*/
|
*/
|
||||||
public static Event UPDATE_EVENT = new Event();
|
public static final Event UPDATE_EVENT = new Event();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateListerner event. Map state has changed in a way that all layers
|
* UpdateListerner event. Map state has changed in a way that all layers
|
||||||
* should clear their state e.g. the theme or the TilesSource has changed.
|
* should clear their state e.g. the theme or the TilesSource has changed.
|
||||||
* TODO should have an event-source to only clear affected layers.
|
* TODO should have an event-source to only clear affected layers.
|
||||||
*/
|
*/
|
||||||
public static Event CLEAR_EVENT = new Event();
|
public static final Event CLEAR_EVENT = new Event();
|
||||||
|
|
||||||
|
public static final Event ANIM_END = 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;
|
||||||
|
|
||||||
private final Layers mLayers;
|
private final Layers mLayers;
|
||||||
private final ViewController mViewport;
|
private final ViewController mViewport;
|
||||||
protected final Animator mAnimator;
|
|
||||||
private final MapPosition mMapPosition;
|
|
||||||
private final AsyncExecutor mAsyncExecutor;
|
private final AsyncExecutor mAsyncExecutor;
|
||||||
|
|
||||||
|
protected final Animator mAnimator;
|
||||||
|
protected final MapPosition mMapPosition;
|
||||||
|
|
||||||
protected final MapEventLayer mEventLayer;
|
protected final MapEventLayer mEventLayer;
|
||||||
protected GestureDetector mGestureDetector;
|
protected GestureDetector mGestureDetector;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user