Class CupertinoPageTransition
- All Implemented Interfaces:
Animation
The iOS page push: two pages moving at different speeds, over different distances.
A plain slide holds the two pages a fixed screen apart and moves the pair, which makes them one rigid object. This transition is the reason iOS depth reads the way it does: the arriving page crosses the WHOLE screen while the page it covers drifts only a THIRD of it, and each rides its own curve. The gap between them closes as they travel, which is what says one is in front of the other.
Sliding both the full distance is not a subtle difference. A third of the way through a push the strip of the old page still showing is not dimmer or shifted -- it is a different PART of that page: measured against the reference at 150ms of a 500ms push on a 1125px screen, the old page belongs 270px to the left and ours had it 855px to the left, so the visible strip showed its far edge where the reference shows its middle.
-
Method Summary
Modifier and TypeMethodDescriptionbooleananimate()Allows the animation to reduce "repaint" calls when it returns false.voidcleanup()Optional operation to cleanup the garbage left over by a running transitioncopy(boolean reverse) Create a copy of the transition, usually the transition used is a copy.static CupertinoPageTransitioncreate(int duration) Creates the transition.intThe push duration in milliseconds.voidCallback thats invoked before a transition begins, the source form may be null for the first form in the application.booleanisBack()Whether this instance plays the way BACK, with the roles of the two pages swapped.voidDraws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.Methods inherited from class Transition
cleanSource, getDestination, getSource, hideInterformContainers, init, paintInterformContainers, showInterformContainers
-
Method Details
-
create
Creates the transition.
Parameters
duration: the push duration in milliseconds
Returns
the transition
-
getDuration
public int getDuration()The push duration in milliseconds.
Returns
the duration this transition was created with
-
isBack
public boolean isBack()Whether this instance plays the way BACK, with the roles of the two pages swapped.
Returns
true if this is the pop half of the transition
-
initTransition
public void initTransition()Description copied from class:TransitionCallback thats invoked before a transition begins, the source form may be null for the first form in the application.- Overrides:
initTransitionin classTransition
-
animate
public boolean animate()Description copied from class:TransitionAllows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the
com.codename1.ui.Displayclass.Returns
true if a repaint is desired or false if no repaint is necessary
- Specified by:
animatein interfaceAnimation- Specified by:
animatein classTransition
-
paint
Description copied from class:TransitionDraws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.
Parameters
g: graphics context
- Specified by:
paintin interfaceAnimation- Specified by:
paintin classTransition
-
cleanup
public void cleanup()Description copied from class:TransitionOptional operation to cleanup the garbage left over by a running transition- Overrides:
cleanupin classTransition
-
copy
Description copied from class:TransitionCreate a copy of the transition, usually the transition used is a copy.
Parameters
reverse: @param reverse creates a new transition instance with "reverse" behavior useful for signifying "back" operations
Returns
new transition instance
- Overrides:
copyin classTransition
-