Created
September 2, 2013 10:01
-
-
Save codenameone/6411227 to your computer and use it in GitHub Desktop.
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
final Form test = new Form("Infinite"); | |
test.setLayout(new BoxLayout(BoxLayout.Y_AXIS)); | |
InfiniteScrollAdapter.createInfiniteScroll(test.getContentPane(), new Runnable() { | |
private int counter = 1; | |
public void run() { | |
// simulate network latency | |
Display.getInstance().invokeAndBlock(new Runnable() { | |
public void run() { | |
try { | |
Thread.sleep(2000); | |
} catch(InterruptedException e) {} | |
} | |
}); | |
Component[] buttons = new Component[20]; | |
for(int iter = 0 ; iter < buttons.length ; iter++) { | |
buttons[iter] = new Button("Button: " + counter); | |
counter++; | |
} | |
InfiniteScrollAdapter.addMoreComponents(test.getContentPane(), buttons, true); | |
} | |
}); | |
test.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment