public class TransitionChangeHandlerCompat extends ControllerChangeHandler
ControllerChangeHandler that facilitates using Transitions to replace Controller Views.
If the target device is running on a version of Android that doesn't support transitions, a fallback ControllerChangeHandler will be used.ControllerChangeHandler.ControllerChangeCompletedListener, ControllerChangeHandler.ControllerChangeListener| Constructor and Description |
|---|
TransitionChangeHandlerCompat() |
TransitionChangeHandlerCompat(TransitionChangeHandler transitionChangeHandler,
ControllerChangeHandler fallbackChangeHandler)
Constructor that takes a
TransitionChangeHandler for use with compatible devices, as well as a fallback
ControllerChangeHandler for use with older devices. |
| 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.
|
ControllerChangeHandler |
copy()
Returns a copy of this ControllerChangeHandler.
|
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() |
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.
|
void |
setForceRemoveViewOnPush(boolean force) |
fromBundle, isReusablepublic TransitionChangeHandlerCompat()
public TransitionChangeHandlerCompat(TransitionChangeHandler transitionChangeHandler, ControllerChangeHandler fallbackChangeHandler)
TransitionChangeHandler for use with compatible devices, as well as a fallback
ControllerChangeHandler for use with older devices.transitionChangeHandler - The change handler that will be used on API 21 and abovefallbackChangeHandler - The change handler that will be used on APIs below 21public 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.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 boolean removesFromViewOnPush()
removesFromViewOnPush in class ControllerChangeHandlerpublic ControllerChangeHandler copy()
ControllerChangeHandlercopy in class ControllerChangeHandlerpublic 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 void setForceRemoveViewOnPush(boolean force)
setForceRemoveViewOnPush in class ControllerChangeHandler