From 67357fe2f0b92549150bb8b4340e485169782208 Mon Sep 17 00:00:00 2001 From: Stephan Leuschner Date: Wed, 10 Aug 2016 00:03:48 -0400 Subject: [PATCH] fire new ANIM_START event when animation is started, do not fire again until all animations are done --- vtm/src/org/oscim/map/Animator.java | 3 +++ vtm/src/org/oscim/map/Map.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/vtm/src/org/oscim/map/Animator.java b/vtm/src/org/oscim/map/Animator.java index 476d6999..797b22a3 100644 --- a/vtm/src/org/oscim/map/Animator.java +++ b/vtm/src/org/oscim/map/Animator.java @@ -1,5 +1,6 @@ /* * Copyright 2013 Hannes Janetzek + * Copyright 2016 Stephan Leuschner * * 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) { + if (!isActive()) + mMap.events.fire(Map.ANIM_START, mMap.mMapPosition); mCurPos.copy(mStartPos); mState = state; mDuration = duration; diff --git a/vtm/src/org/oscim/map/Map.java b/vtm/src/org/oscim/map/Map.java index 43341196..618f80c0 100644 --- a/vtm/src/org/oscim/map/Map.java +++ b/vtm/src/org/oscim/map/Map.java @@ -1,6 +1,7 @@ /* * Copyright 2013 Hannes Janetzek * Copyright 2016 Andrey Novikov + * Copyright 2016 Stephan Leuschner * * 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_START = new Event(); + public final EventDispatcher input; public final EventDispatcher events;