public interface WindowTransition
extends android.os.Parcelable
overrideStart(Activity) and overrideFinish(Activity).
// Activity A implementation.
public class ActivityA extends Activity {
public void startActivityB() {
startActivity(new Intent(this, ActivityB.class));
WindowTransition.overrideStart(this);
}
}
// Activity B implementation.
public class ActivityB extends Activity {
@Override
public void finish() {
super.finish();
WindowTransition.overrideFinish(this);
}
}
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_ANIMATION
Constant used to identify no animation resource provided by window transition.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getFinishEnterAnimation()
Returns the animation resource for an old entering/resuming window used in
overrideFinish(Activity)
as enter animation. |
int |
getFinishExitAnimation()
Returns the animation resource for the current exiting/finishing window used in
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
overrideStart(Activity)
as enter animation. |
int |
getStartExitAnimation()
Returns the animation resource for the current exiting/pausing window used in
overrideStart(Activity)
as exit animation. |
void |
overrideFinish(android.app.Activity activity)
Overrides pending transitions of the specified activity using
getFinishEnterAnimation()
and getFinishExitAnimation() animations specified for this window transition. |
void |
overrideStart(android.app.Activity activity)
Overrides pending transitions of the specified activity using
getStartEnterAnimation()
and getStartExitAnimation() animations specified for this window transition. |
static final int NO_ANIMATION
int getStartEnterAnimation()
overrideStart(Activity)
as enter animation.NO_ANIMATION if no animation should be played for
entering activity window.int getStartExitAnimation()
overrideStart(Activity)
as exit animation.NO_ANIMATION if no animation should be played for
exiting activity window.int getFinishEnterAnimation()
overrideFinish(Activity)
as enter animation.NO_ANIMATION if no animation should be played for
entering back-stacked activity window.int getFinishExitAnimation()
overrideFinish(Activity)
as exit animation.NO_ANIMATION if no animation should be played for
exiting back-stacked activity window.String getName()
void overrideStart(android.app.Activity activity)
getStartEnterAnimation()
and 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.
activity - The caller or starting activity of which pending transition to override.overrideFinish(Activity)void overrideFinish(android.app.Activity activity)
getFinishEnterAnimation()
and 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.
activity - The finishing activity of which pending transition to override.overrideStart(Activity)