Reputation: 235
This creates a SwipeableContainer inside a Tab, but the swipe gesture is always detected by both the SwipeableContainer and the Tab (i.e. It shows the button under SwipeableContainer and move the page back to the left tab simultaneously when my finger swipes from left to right), which makes it very difficult to press the button behind it.
Is there any way to detect the gesture on SwipeableContainer only?
Tabs main_tab = new Tabs();
Container query_container;
Container history_container;
history_container = new Container(new BoxLayout(BoxLayout.Y_AXIS));
MultiButton his_btn = new MultiButton("History");
Button delete_btn = new Button("delete");
SwipeableContainer his_list_container = new SwipeableContainer(delete_btn,his_btn);
history_container.add(his_list_container);
main_tab.addTab("query", query_icon, query_container);
main_tab.addTab("history", history_icon, history_container);
Upvotes: 3
Views: 69
Reputation: 1166
I think that you can just remove the Swipe Gesture for the Tabs using the following method:
main_tab_.setSwipeActivated(false);
From the codenameone documentation:
public void setSwipeActivated(boolean swipeActivated)
Setter method for swipe mode
Upvotes: 2