public final class CupertinoPageTransition

  1. Object
  2. Transition
  3. CupertinoPageTransition

ImplementsAnimation

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.

Methods

public static CupertinoPageTransition create(int duration)Creates the transition.
public int getDuration()The push duration in milliseconds.
public boolean isBack()Whether this instance plays the way BACK, with the roles of the two pages swapped.
public void initTransition()Callback thats invoked before a transition begins, the source form may be null for the first form in the application.
public boolean animate()Allows the animation to reduce “repaint” calls when it returns false.
public void paint(Graphics g)Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.
public void cleanup()Optional operation to cleanup the garbage left over by a running transition
public Transition copy(boolean reverse)Create a copy of the transition, usually the transition used is a copy.

Inherited methods

Method details

create

public static CupertinoPageTransition create(int duration)
Creates the transition.

Parameters

duration int
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()
Callback thats invoked before a transition begins, the source form may be null for the first form in the application.

animate

public boolean animate()
Allows 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.Display class.

Returns

true if a repaint is desired or false if no repaint is necessary

paint

public void paint(Graphics g)
Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.

Parameters

g Graphics
graphics context

cleanup

public void cleanup()
Optional operation to cleanup the garbage left over by a running transition

copy

public Transition copy(boolean reverse)
Create a copy of the transition, usually the transition used is a copy.

Parameters

reverse boolean
creates a new transition instance with “reverse” behavior useful for signifying “back” operations

Returns

new transition instance