public class BasicWindowTransition extends Object implements WindowTransition
WindowTransition that may be used to create basic instances of window
transitions to animate window changes.Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<BasicWindowTransition> |
CREATOR
Creator used to create an instance or array of instances of BasicWindowTransition from
Parcel. |
NO_ANIMATIONCONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Modifier | Constructor and Description |
|---|---|
|
BasicWindowTransition(int enterAnim,
int exitAnim)
Same as
BasicWindowTransition(int, int, int, int) where finish animations are set to
WindowTransition.NO_ANIMATION. |
|
BasicWindowTransition(int startEnterAnim,
int startExitAnim,
int finishEnterAnim,
int finishExitAnim)
Same as
BasicWindowTransition(int, int, int, int, String) with name specified
as "UNSPECIFIED". |
|
BasicWindowTransition(int startEnterAnim,
int startExitAnim,
int finishEnterAnim,
int finishExitAnim,
String name)
Creates a new instance of BasicWindowTransition with the specified animations and name.
|
protected |
BasicWindowTransition(Parcel source)
Called form
CREATOR to create an instance of WindowTransition form the given parcel
source. |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
int |
getFinishEnterAnimation()
Returns the animation resource for an old entering/resuming window used in
WindowTransition.overrideFinish(Activity)
as enter animation. |
int |
getFinishExitAnimation()
Returns the animation resource for the current exiting/finishing window used in
WindowTransition.overrideFinish(Activity)
as exit animation. |
String |
getName()
Returns the name of this window transition.
|
int |
getStartEnterAnimation()
Returns the animation resource for a new entering/starting window used in
WindowTransition.overrideStart(Activity)
as enter animation. |
int |
getStartExitAnimation()
Returns the animation resource for the current exiting/pausing window used in
WindowTransition.overrideStart(Activity)
as exit animation. |
void |
overrideFinish(Activity activity)
Overrides pending transitions of the specified activity using
WindowTransition.getFinishEnterAnimation()
and WindowTransition.getFinishExitAnimation() animations specified for this window transition. |
void |
overrideStart(Activity activity)
Overrides pending transitions of the specified activity using
WindowTransition.getStartEnterAnimation()
and WindowTransition.getStartExitAnimation() animations specified for this window transition. |
void |
writeToParcel(Parcel dest,
int flags) |
public static final Parcelable.Creator<BasicWindowTransition> CREATOR
Parcel.public BasicWindowTransition(@AnimRes int enterAnim, @AnimRes int exitAnim)
BasicWindowTransition(int, int, int, int) where finish animations are set to
WindowTransition.NO_ANIMATION.public BasicWindowTransition(@AnimRes int startEnterAnim, @AnimRes int startExitAnim, @AnimRes int finishEnterAnim, @AnimRes int finishExitAnim)
BasicWindowTransition(int, int, int, int, String) with name specified
as "UNSPECIFIED".public BasicWindowTransition(@AnimRes int startEnterAnim, @AnimRes int startExitAnim, @AnimRes int finishEnterAnim, @AnimRes int finishExitAnim, @NonNull String name)
startEnterAnim - A resource id of the animation for an entering window.startExitAnim - A resource id of the animation for an exiting window to be added to the
back stack (if).finishEnterAnim - A resource id of the animation for an entering window to be showed from
the back stack.finishExitAnim - A resource id of the animation for an exiting window to be destroyed and
replaced by the entering one.name - Name for the new transition.overrideStart(Activity),
overrideFinish(Activity)public void writeToParcel(@NonNull Parcel dest, int flags)
writeToParcel in interface Parcelablepublic int describeContents()
describeContents in interface Parcelable@AnimRes public int getStartEnterAnimation()
WindowTransitionWindowTransition.overrideStart(Activity)
as enter animation.getStartEnterAnimation in interface WindowTransitionWindowTransition.NO_ANIMATION if no animation should be played for
entering activity window.@AnimRes public int getStartExitAnimation()
WindowTransitionWindowTransition.overrideStart(Activity)
as exit animation.getStartExitAnimation in interface WindowTransitionWindowTransition.NO_ANIMATION if no animation should be played for
exiting activity window.@AnimRes public int getFinishEnterAnimation()
WindowTransitionWindowTransition.overrideFinish(Activity)
as enter animation.getFinishEnterAnimation in interface WindowTransitionWindowTransition.NO_ANIMATION if no animation should be played for
entering back-stacked activity window.@AnimRes public int getFinishExitAnimation()
WindowTransitionWindowTransition.overrideFinish(Activity)
as exit animation.getFinishExitAnimation in interface WindowTransitionWindowTransition.NO_ANIMATION if no animation should be played for
exiting back-stacked activity window.@NonNull public String getName()
WindowTransitiongetName in interface WindowTransitionpublic void overrideStart(@NonNull Activity activity)
WindowTransitionWindowTransition.getStartEnterAnimation()
and WindowTransition.getStartExitAnimation() animations specified for this window transition.
This method may be called to override default start animations when starting a new activity.
The specified activity can be either a caller activity that starts a new activity via Intent
or the started activity. In the first case this should be called immediately after
Activity.startActivity(Intent) has been called. In the second case this method should
be called from within Activity.onStart() of the started activity.
overrideStart in interface WindowTransitionactivity - The caller or starting activity of which pending transition to override.WindowTransition.overrideFinish(Activity)public void overrideFinish(@NonNull Activity activity)
WindowTransitionWindowTransition.getFinishEnterAnimation()
and WindowTransition.getFinishExitAnimation() animations specified for this window transition.
This method may be called to override default finish animations when finishing currently visible
activity from within Activity.finish() method.
overrideFinish in interface WindowTransitionactivity - The finishing activity of which pending transition to override.WindowTransition.overrideStart(Activity)