Created
January 31, 2016 12:23
-
-
Save codenameone/38c076760e309c066126 to your computer and use it in GitHub Desktop.
Animates a "falling" effect using animate layout from Codename One
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Layout Animations", new BoxLayout(BoxLayout.Y_AXIS)); | |
Button fall = new Button("Fall"); | |
fall.addActionListener((e) -> { | |
for(int iter = 0 ; iter < 10 ; iter++) { | |
Label b = new Label ("Label " + iter); | |
b.setWidth(fall.getWidth()); | |
b.setHeight(fall.getHeight()); | |
b.setY(-fall.getHeight()); | |
hi.add(b); | |
} | |
hi.getContentPane().animateLayout(20000); | |
}); | |
hi.add(fall); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample usage code for animateLayout
From the Codename One project