i have a list view with swipeble container i want to know how to handle action if im swiping container then a button will appear and if im clicking a new form will be shown

5 views
Skip to first unread message

b.wassim Rmd

unread,
Apr 26, 2017, 3:18:14 PM4/26/17
to CodenameOne Discussions
i have a list view with swipeble container i want to know how to handle action if im swiping container then a button will appear and if im clicking a new form will be shown  
how can i handle this 

this is my code 

 ArrayList<Membre> am = gs.getAllm();
                    for (Membre i : am) {
                        Container ctn1 = new Container(new BoxLayout(BoxLayout.X_AXIS));
                        Container ctn2 = new Container(new BoxLayout(BoxLayout.Y_AXIS));
                        Label lblSurnom = new Label("Surnom : " + i.getNom());
                        ctn2.add(new Label("Nom : " + i.getUsername() + " " + i.getPrenom()));
                        ctn2.add(lblSurnom);

                        lblSurnom.addPointerReleasedListener(ev -> {

                            //display detail
                            new MembreForm().displayDetailMember(i, theme, member);

                        });

                        ctn1.setLeadComponent(lblSurnom);

                        Image imgServer = theme.getImage(i.getProfil_pic());

                        ImageViewer imgProfile = new ImageViewer(imgServer);

                        ctn1.add(imgProfile);
                        ctn1.add(ctn2);
                        Button btndelete = new Button();
                        btndelete.setIcon(theme.getImage("delete.png"));
                        btndelete.setUIID("container");
                        SwipeableContainer sp = new SwipeableContainer(btndelete, ctn1);
                        
                        

                        member.add(sp);


If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

IDE: NetBeans
Simulator
Reply all
Reply to author
Forward
0 new messages