cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting a page change on Swipe Container.

ALew.1
Associate

I am currently using a swipe container that goes between 3 pages by either swiping or using a next/back button on the bottom corners of the screen to change pages. The page indicators are overlapping with the next/back buttons when I do swiping so I was going to not use the built in page indicators and implement my own. The issue is on my next/back button presses, I change the page index and keep track of it so it is easy to update manually the page indicators but I have no way of detecting a swipe page change to update the page indicators. Is there a way to detect a page change on a swipe container?

2 REPLIES 2
Alexandre RENOUX
Principal

Hello ALew.1,

Unfortunately, there's no built-in feature implemented in the widget itself to detect a swipe.

One solution is to make your own SwipeContainer by copy/pasting the available widget into gui/src/common and gui/include/common, and then modify/add the necessary code.

You can create callbacks that trigger some handler function in your view which tells you if you swiped or not. You can even directly retrieve the new page index from the callback.

The only downside is that everything will be done by code and you will not see your swipe container in the Designer.

/Alexandre

SofLit
ST Employee

Hello,

You can do Swipe gesture between screens without using Swipe widget.

Please refer to this thread.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.