1

I haven't found any sort of serial transition class in CN1. Did I miss it? What I want to do is fade some components at the top of my form, slide a component from the bottom up to the top, and then fade a few new components in at the bottom of the form. Is there an easy way to build up these transitions and then execute them in sequence?

1 Answers1

0

There are a lot of classes related to transitions and animations, you can see many of these effects in the demos (e.g. kitchen sink etc.).

To transition a form you can use the Transition class or CommonTransition see https://www.codenameone.com/javadoc/com/codename1/ui/animations/package-summary.html

The cool thing is that you can also apply a transition to the process of replacing one component with another e.g. this is from the Solitaire demo:

getParent().replaceAndWait(this, new CardComponent(c, front, back, faceingUp), new FlipTransition(-1, 150));

To sequence these in a series just use the "and wait" version and then do the next animation. E.g. animateLayoutAndWait followed by a replaceAndWait.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Can I use the newest third party iOS animation / transition libraries, instead of depending on Codenameone wrappers? If so, how? – Srikanth Jan 20 '16 at 12:54
  • Those don't make sense in the Codename One architecture. You can embed native code and use native transitions there but since portability in Codename One hinges on lightweight API's see https://www.codenameone.com/blog/understanding-peer-native-components-why-codename-one-is-so-portable.html & http://stackoverflow.com/questions/10639766/how-codename-one-works/10646336 – Shai Almog Jan 21 '16 at 03:52