-
public abstract class AnimatorChangeHandler extends ControllerChangeHandler
A base ControllerChangeHandler that facilitates using android.animation.Animators to replace Controller Views
-
-
Field Summary
Fields Modifier and Type Field Description public final static longDEFAULT_ANIMATION_DURATIONprivate longanimationDuration
-
Constructor Summary
Constructors Constructor Description AnimatorChangeHandler()AnimatorChangeHandler(boolean removesFromViewOnPush)AnimatorChangeHandler(long duration)AnimatorChangeHandler(long duration, boolean removesFromViewOnPush)
-
Method Summary
Modifier and Type Method Description longgetAnimationDuration()voidsaveToBundle(@NonNull() Bundle bundle)Saves any data about this handler to a Bundle in case the application is killed. voidrestoreFromBundle(@NonNull() Bundle bundle)Restores data that was saved in the saveToBundle method. voidonAbortPush(@NonNull() ControllerChangeHandler newHandler, @Nullable() Controller newTop)Will be called on change handlers that push a controller if the controller being pushed ispopped before it has completed. voidcompleteImmediately()Will be called on change handlers that push a controller if the controller being pushed isneeds to be attached immediately, without any animations or transitions. booleanremovesFromViewOnPush()final voidperformChange(@NonNull() ViewGroup container, @Nullable() View from, @Nullable() View to, boolean isPush, @NonNull() ControllerChangeHandler.ControllerChangeCompletedListener changeListener)Responsible for swapping Views from one Controller to another. -
-
Method Detail
-
getAnimationDuration
long getAnimationDuration()
-
saveToBundle
void saveToBundle(@NonNull() Bundle bundle)
Saves any data about this handler to a Bundle in case the application is killed.
- Parameters:
bundle- The Bundle into which data should be stored.
-
restoreFromBundle
void restoreFromBundle(@NonNull() Bundle bundle)
Restores data that was saved in the saveToBundle method.
- Parameters:
bundle- The bundle that has data to be restored
-
onAbortPush
void onAbortPush(@NonNull() ControllerChangeHandler newHandler, @Nullable() Controller newTop)
Will be called on change handlers that push a controller if the controller being pushed ispopped before it has completed.
- Parameters:
newHandler- The change handler that has caused this push to be abortednewTop- The Controller that will now be at the top of the backstack or{@code null}if there will be no new Controller at the top
-
completeImmediately
void completeImmediately()
Will be called on change handlers that push a controller if the controller being pushed isneeds to be attached immediately, without any animations or transitions.
-
removesFromViewOnPush
boolean removesFromViewOnPush()
-
performChange
final void performChange(@NonNull() ViewGroup container, @Nullable() View from, @Nullable() View to, boolean isPush, @NonNull() ControllerChangeHandler.ControllerChangeCompletedListener changeListener)
Responsible for swapping Views from one Controller to another.
- Parameters:
container- The container these Views are hosted in.from- The previous View in the container or{@code null}if there was no Controller before this transitionto- The next View that should be put in the container or{@code 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.
-
-
-
-