If you are experiencing an issue please mention the full platform your
issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 11.0
Desktop OS Windows 10 Pro
Simulator Latest
Device PC, IOS, Android
I have 2 SpanButton components in a Swipeable container, however the swipe
action is rarley caught.
However if I substitute SpanButton with Button, the operation behaves as
expected.
Here is a repeatable test case.
Form hi = new Form("MpiImagesSwipeableContainer", new
BoxLayout(BoxLayout.Y_AXIS));
Container ctr = new Container(new BoxLayout(BoxLayout.Y_AXIS));
ctr.setScrollableY(true);
for (int a = 0; a < 5; a++) {
Container TestCont = new Container(new
com.codename1.ui.table.TableLayout(1, 2), "SchedEditContainerThickBorder");
TextArea SrvJobText = new TextArea("A-" + (a + 1) + "
Service");
SrvJobText.setHint("Touch To Open Service Jobs Menu");
SrvJobText.setEditable(true);
TextArea SrvJobText1 = new TextArea("B-" + (a + 1) + "
Service");
SrvJobText1.setHint("Touch To Open Service Jobs Menu");
SrvJobText1.setEditable(true);
buildConstrantsGeneric(TestCont, SrvJobText, 0, 0, 50);
buildConstrantsGeneric(TestCont, SrvJobText1, 0, 1, 50);
SrvJobText.setUIID("MpServiceField");
SpanButton menuButton = new SpanButton("Delete");
menuButton.setName("Button");
menuButton.setUIID("A3VacTableTotalHrsCellRed");
SpanButton editButton = new SpanButton("Edit");
editButton.setName("Button");
editButton.setUIID("A3VacTableTotalHrsCell");
SwipeableContainer MpiImagesSwipeableContainer = new
SwipeableContainer(menuButton, editButton, TestCont);
MpiImagesSwipeableContainer.setUIID("SwipeableContainerRoundedBorder");
menuButton.addActionListener((evt) -> {
MpiImagesSwipeableContainer.close();
});
menuButton.addFocusListener(new FocusListener() {
@Override
public void focusGained(Component cmp) {
System.out.println("menuButton: focusGained");
}
@Override
public void focusLost(Component cmp) {
System.out.println("menuButton: focusLost");
MpiImagesSwipeableContainer.close();
}
});
editButton.addActionListener((evt) -> {
MpiImagesSwipeableContainer.close();
});
ctr.add(MpiImagesSwipeableContainer);
MpiImagesSwipeableContainer.addSwipeOpenListener(e -> {
menuButton.requestFocus();
});
}
hi.add(ctr);
hi.show();
Regards
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/3fccbf27-e336-47a0-adde-d654a19c6f4a%40googlegroups.com.