public interface TransitionContext
Transition animates a page change.
Given to Transition.run(TransitionContext, TransitionListener), it exposes the outgoing and
incoming content, the content area size, and the two primitives a transition uses to render itself:
positionContents(int, int, int, int) to slide the content widgets, and
blendIncoming(int) to fade the incoming content in over the outgoing one. A transition
registers its Animation with animate(Animation) so the navigator can snap it to
completion if a new navigation interrupts it.
Both content widgets share the same content area, laid out to fill it. Coordinates passed to
positionContents(int, int, int, int) are relative to the top-left of the content area.
The navigator supplies the implementation; an application consumes this interface from its
Transition and is not expected to implement it.
| Modifier and Type | Method and Description |
|---|---|
void |
animate(Animation animation)
Registers and starts the animation that drives this transition.
|
void |
blendIncoming(int opacity)
Blends the incoming content over the outgoing one at the given opacity and requests a render.
|
int |
getContentHeight()
Returns the height of the content area shared by both contents.
|
int |
getContentWidth()
Returns the width of the content area shared by both contents.
|
Widget |
getIncomingContent()
Returns the content of the page being entered.
|
Widget |
getOutgoingContent()
Returns the content of the page being left, or
null when there is none. |
void |
positionContents(int outgoingX,
int outgoingY,
int incomingX,
int incomingY)
Positions the outgoing and incoming contents within the content area and requests a render.
|
void animate(Animation animation)
The navigator stops this animation if a new navigation interrupts the transition.
animation - the animation to run.void blendIncoming(int opacity)
opacity - the incoming content opacity, from 0 (fully transparent) to 255 (fully
opaque).int getContentHeight()
int getContentWidth()
Widget getIncomingContent()
@Nullable Widget getOutgoingContent()
null when there is none.null if there is none.void positionContents(int outgoingX,
int outgoingY,
int incomingX,
int incomingY)
Coordinates are relative to the top-left of the content area. When there is no outgoing content, its coordinates are ignored.
outgoingX - the x of the outgoing content.outgoingY - the y of the outgoing content.incomingX - the x of the incoming content.incomingY - the y of the incoming content.