-
- All Implemented Interfaces:
-
android.view.View.OnAttachStateChangeListener
public class SimpleSwapChangeHandler extends ControllerChangeHandler implements View.OnAttachStateChangeListener
A ControllerChangeHandler that will instantly swap Views with no animations or transitions.
-
-
Constructor Summary
Constructors Constructor Description SimpleSwapChangeHandler()SimpleSwapChangeHandler(boolean removesFromViewOnPush)
-
Method Summary
Modifier and Type Method Description 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. 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. booleanremovesFromViewOnPush()voidonViewAttachedToWindow(@NonNull() View v)voidonViewDetachedFromWindow(@NonNull() View v)ControllerChangeHandlercopy()Returns a copy of this ControllerChangeHandler. booleanisReusable()Returns whether or not this is a reusable ControllerChangeHandler. -
Methods inherited from class com.bluelinelabs.conductor.ControllerChangeHandler
fromBundle, setForceRemoveViewOnPush -
Methods inherited from class android.view.View.OnAttachStateChangeListener
onViewAttachedToWindow, onViewDetachedFromWindow -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
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.
-
performChange
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.
-
removesFromViewOnPush
boolean removesFromViewOnPush()
-
onViewAttachedToWindow
void onViewAttachedToWindow(@NonNull() View v)
-
onViewDetachedFromWindow
void onViewDetachedFromWindow(@NonNull() View v)
-
copy
@NonNull() ControllerChangeHandler copy()
Returns a copy of this ControllerChangeHandler. This method is internally used by the library, soensure it will return an exact copy of your handler if overriding. If not overriding, the handlerwill be saved and restored from the Bundle format.
-
isReusable
boolean isReusable()
Returns whether or not this is a reusable ControllerChangeHandler. Defaults to false and shouldONLY be overridden if there are absolutely no side effects to using this handler more than once.In the case that a handler is not reusable, it will be copied using the copy methodprior to use.
-
-
-
-