Package com.aerisweather.aeris.maps
Class AnimationController
- java.lang.Object
-
- com.aerisweather.aeris.maps.AnimationController
-
- All Implemented Interfaces:
LoadTileAnimationTask.LoadAmpTileCallback
public class AnimationController extends Object implements LoadTileAnimationTask.LoadAmpTileCallback
Controller that manages the animations for the AerisMapView.
-
-
Constructor Summary
Constructors Constructor Description AnimationController(AerisMapView mapView)
Initializes the controller with the mapview and will pull the default animation speed and opacity from the AerisMapsEngine.AnimationController(AerisMapView mapView, AerisMapOptions options)
Initializes the controller with the mapview and with map options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
backPressed()
Event of step being called so that the animation will step to the previous frame and stop.void
handleImages(List<AerisAmpAnimationInfo> images)
Callback method when the tiles have been loading.void
hideAnimation()
Hides the animationvoid
moveToIndex(int index)
Moves the animation to the specified index and stops.void
nextPressed()
Event of step being called so that the animation will step to the next frame and stop.void
pauseAnimations()
Pauses the animationvoid
playAnimations()
Plays the animationsvoid
setMapMoved(com.google.android.gms.maps.model.LatLng latlng, int zoom)
Call this method to notify that the map has moved.void
setProgressListener(LoadTileAnimationTask.LoadTileProgressBar bar)
Sets the progress listener for this controller.void
setTileDisplayDelegate(AerisTileDisplayDelegate delegate)
Sets the tile display delegate.void
setTileStepDelegate(AerisTileStepDelegate stepDelegate)
Sets the tile step delegate.void
updateOptions(AerisMapOptions options)
Updates the options to use for opacity and animation speed.
-
-
-
Constructor Detail
-
AnimationController
public AnimationController(AerisMapView mapView, AerisMapOptions options)
Initializes the controller with the mapview and with map options. This will cause the animation controller to base its range of animation speed and opacity based on the aeris map options.- Parameters:
mapView
- Aeris mapview to use for animations.options
- AerisMapOptions to use for opacity and animation speed settings.
-
AnimationController
public AnimationController(AerisMapView mapView)
Initializes the controller with the mapview and will pull the default animation speed and opacity from the AerisMapsEngine. These values can also be set passing a AerisMapOptions toupdateOptions(AerisMapOptions)
.- Parameters:
mapView
- MapView to initialize with
-
-
Method Detail
-
setProgressListener
public void setProgressListener(LoadTileAnimationTask.LoadTileProgressBar bar)
Sets the progress listener for this controller. The controller will now pass loading tile information to its listener.- Parameters:
bar
- progress listener to pass information back to
-
updateOptions
public void updateOptions(AerisMapOptions options)
Updates the options to use for opacity and animation speed.- Parameters:
options
- options to use.
-
setTileDisplayDelegate
public void setTileDisplayDelegate(AerisTileDisplayDelegate delegate)
Sets the tile display delegate. This allows the controller to pass tile name and date info to a delegate as new frames are animated.- Parameters:
delegate
- delegate to pass info to.
-
setTileStepDelegate
public void setTileStepDelegate(AerisTileStepDelegate stepDelegate)
Sets the tile step delegate. This allows the controller to pass which animation step the animation is on and allow the delegate to display which step it is.- Parameters:
stepDelegate
- delegate to pass step information to
-
setMapMoved
public void setMapMoved(com.google.android.gms.maps.model.LatLng latlng, int zoom)
Call this method to notify that the map has moved. This is done by the AerisMapView automatically on camera moved so that the animations will be stopped.
-
hideAnimation
public void hideAnimation()
Hides the animation
-
nextPressed
public void nextPressed()
Event of step being called so that the animation will step to the next frame and stop.
-
backPressed
public void backPressed()
Event of step being called so that the animation will step to the previous frame and stop.
-
moveToIndex
public void moveToIndex(int index)
Moves the animation to the specified index and stops.- Parameters:
index
- index to move to.
-
playAnimations
public void playAnimations()
Plays the animations
-
pauseAnimations
public void pauseAnimations()
Pauses the animation
-
handleImages
public void handleImages(List<AerisAmpAnimationInfo> images)
Description copied from interface:LoadTileAnimationTask.LoadAmpTileCallback
Callback method when the tiles have been loading.- Specified by:
handleImages
in interfaceLoadTileAnimationTask.LoadAmpTileCallback
- Parameters:
images
- List of data objects containing information on the images.
-
-