Scrollable x of buttons not running freely

29 views
Skip to first unread message

Carlos Verdier

unread,
Oct 31, 2017, 7:48:23 AM10/31/17
to CodenameOne Discussions
Hi

Given the following code:

        Form f = new Form(new BorderLayout());
        Container cont = new Container(new BoxLayout(BoxLayout.X_AXIS));
        cont.setScrollableX(true);
        for (int x=0; x<20; x++) {
            Button btn = new Button();
            FontImage.setMaterialIcon(btn, FontImage.MATERIAL_APPS, 20);
            cont.add(btn);
        }
        f.add(BorderLayout.SOUTH, cont);
        f.show();


This works fine on simulator, but not on Android (have not tried on iOS). Scrolling through the buttons, it gets stuck after lifting the finger, instead of scrolling freely. Changing buttons for labels solves the problem, so it probably has to do with actions... This same configuration used to work about 2 weeks ago.

Any ideas?

Thanks

Carlos Verdier

unread,
Oct 31, 2017, 8:30:11 AM10/31/17
to CodenameOne Discussions
This workaround solves the problem for now...

        Form f = new Form(new BorderLayout());
        Container cont = new Container(new BoxLayout(BoxLayout.X_AXIS));
        cont.setScrollableX(true);
        for (int x=0; x<20; x++) {
            Button btn = new Button();
            FontImage.setMaterialIcon(btn, FontImage.MATERIAL_APPS, 20);
            Container contButton = new Container(new BorderLayout());
            contButton.add(BorderLayout.CENTER, btn);
            contButton.setLeadComponent(btn);
            cont.add(contButton);
        }
        f.add(BorderLayout.SOUTH, cont);
        f.show();



Shai Almog

unread,
Nov 1, 2017, 1:19:44 AM11/1/17
to CodenameOne Discussions
Odd, can you please file an issue ASAP? I'd like to evaluate this before the code freeze next week and have a lot of ongoing tasks so hopefully we'll get to it. I'm concerned this might be a recent regression.
Reply all
Reply to author
Forward
0 new messages