Swipe to navigate

28 views
Skip to first unread message

Gareth Murfin

unread,
Aug 3, 2016, 9:10:05 AM8/3/16
to CodenameOne Discussions
I have a single screen which shows some content from an array, I wish to be able to swipe left and right to go to the same screen but populate it with the next item in the array. What is the easiest way to do this ? I guess I could use a layeredLayout and have a container on top and detect the swipe on that? But also then wont buttons underneath stop working? That would not be a big problem because theyre near the bottom, so really people will swipe around the middle of the screen. Can you detect a swipe on things like textareas (un editable) or containers?

Shai Almog

unread,
Aug 4, 2016, 12:55:21 AM8/4/16
to CodenameOne Discussions
I would use tabs and create the same container with different data to add in.
You can set the tabs to be hidden.

Gareth Murfin

unread,
Aug 4, 2016, 9:46:46 AM8/4/16
to CodenameOne Discussions
Never even heard of Tabs! Nice little component that, works really nice, thanks!!

Gareth Murfin

unread,
Aug 4, 2016, 10:13:57 AM8/4/16
to CodenameOne Discussions
tabs.setHidden() doesnt seem to do anything on the emulator or device? i tried with true, and true, true

Gareth Murfin

unread,
Aug 4, 2016, 11:14:25 AM8/4/16
to CodenameOne Discussions
Also, how can I turn off the ability to being my left side menu out by swiping, now that I have tabs i dont want that to confuse things. 

My left on uses this SideMenuBar smb = (SideMenuBar) Display.getInstance().getCurrent().getMenuBar();

do i just set sideMenuFoldedSwipeBool to false?

Thanks,
Gaz

Shai Almog

unread,
Aug 5, 2016, 2:15:44 AM8/5/16
to CodenameOne Discussions
Not setHidden(). hideTabs().

Yes sideMenuFoldedSwipeBool=false will turn that off.
Reply all
Reply to author
Forward
0 new messages