public abstract class AnimatorChangeHandler extends ControllerChangeHandler
ControllerChangeHandler that facilitates using Animators to replace Controller ViewsControllerChangeHandler.ControllerChangeCompletedListener, ControllerChangeHandler.ControllerChangeListener| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_ANIMATION_DURATION |
| Constructor and Description |
|---|
AnimatorChangeHandler() |
AnimatorChangeHandler(boolean removesFromViewOnPush) |
AnimatorChangeHandler(long duration) |
AnimatorChangeHandler(long duration,
boolean removesFromViewOnPush) |
| Modifier and Type | Method and Description |
|---|---|
void |
completeImmediately()
Will be called on change handlers that push a controller if the controller being pushed is
needs to be attached immediately, without any animations or transitions.
|
long |
getAnimationDuration() |
protected abstract android.animation.Animator |
getAnimator(android.view.ViewGroup container,
android.view.View from,
android.view.View to,
boolean isPush,
boolean toAddedToContainer)
Should be overridden to return the Animator to use while replacing Views.
|
void |
onAbortPush(ControllerChangeHandler newHandler,
Controller newTop)
Will be called on change handlers that push a controller if the controller being pushed is
popped before it has completed.
|
void |
performChange(android.view.ViewGroup container,
android.view.View from,
android.view.View to,
boolean isPush,
ControllerChangeHandler.ControllerChangeCompletedListener changeListener)
Responsible for swapping Views from one Controller to another.
|
boolean |
removesFromViewOnPush() |
protected abstract void |
resetFromView(android.view.View from)
Will be called after the animation is complete to reset the View that was removed to its pre-animation state.
|
void |
restoreFromBundle(android.os.Bundle bundle)
Restores data that was saved in the
ControllerChangeHandler.saveToBundle(Bundle bundle) method. |
void |
saveToBundle(android.os.Bundle bundle)
Saves any data about this handler to a Bundle in case the application is killed.
|
copy, fromBundle, isReusable, setForceRemoveViewOnPushpublic static final long DEFAULT_ANIMATION_DURATION
public AnimatorChangeHandler()
public AnimatorChangeHandler(boolean removesFromViewOnPush)
public AnimatorChangeHandler(long duration)
public AnimatorChangeHandler(long duration,
boolean removesFromViewOnPush)
public void saveToBundle(android.os.Bundle bundle)
ControllerChangeHandlersaveToBundle in class ControllerChangeHandlerbundle - The Bundle into which data should be stored.public void restoreFromBundle(android.os.Bundle bundle)
ControllerChangeHandlerControllerChangeHandler.saveToBundle(Bundle bundle) method.restoreFromBundle in class ControllerChangeHandlerbundle - The bundle that has data to be restoredpublic void onAbortPush(ControllerChangeHandler newHandler, Controller newTop)
ControllerChangeHandleronAbortPush in class ControllerChangeHandlernewHandler - The change handler that has caused this push to be abortednewTop - The Controller that will now be at the top of the backstack or null
if there will be no new Controller at the toppublic void completeImmediately()
ControllerChangeHandlercompleteImmediately in class ControllerChangeHandlerpublic long getAnimationDuration()
public boolean removesFromViewOnPush()
removesFromViewOnPush in class ControllerChangeHandlerprotected abstract android.animation.Animator getAnimator(android.view.ViewGroup container,
android.view.View from,
android.view.View to,
boolean isPush,
boolean toAddedToContainer)
container - The container these Views are hosted in.from - The previous View in the container or null if there was no Controller before this transitionto - The next View that should be put in the container or null if no Controller is being transitioned toisPush - True if this is a push transaction, false if it's a pop.toAddedToContainer - True if the "to" view was added to the container as a part of this ChangeHandler. False if it was already in the hierarchy.protected abstract void resetFromView(android.view.View from)
public final void performChange(android.view.ViewGroup container,
android.view.View from,
android.view.View to,
boolean isPush,
ControllerChangeHandler.ControllerChangeCompletedListener changeListener)
ControllerChangeHandlerperformChange in class ControllerChangeHandlercontainer - The container these Views are hosted in.from - The previous View in the container or null if there was no Controller before this transitionto - The next View that should be put in the container or null if no Controller is being transitioned toisPush - True if this is a push transaction, false if it's a pop.changeListener - This listener must be called when any transitions or animations are completed.