Android Question Swipe navigation

Acuario

Active Member
Licensed User
Longtime User
I have B4A (B4X) app with 3 pages. I want to navigate between the pages by right or left swiping the screen (to move to the next/previous screen).

I have managed to achieve this by putting all the page views in a panel the size of the screen with the parent Activity (pnlDrag), then adding a second panel again full screen with the parent Activity (pnlScreen). Both are transparent and sent to the back of the z-order.

I then have a sub pnlScreen_Touch where I set the initial X when the user touches the screen then set the left property of pnlDrag when X changes.

This works ok.

I have seen though that there is a TouchPanel in the ViewsEx library.
I'm wondering if I should be using this instead - would it be simpler?
But - no samples or code that I can find to show how it's used (except some bits heavily embedded in a CustomListView example).

Any ideas anyone?
 

josejad

Expert
Licensed User
Longtime User
Maybe this?

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…