2020-05-21 03:12 AM
[Q1] I have 3 pages in a swipecontainer in my program. One of them is a watch face and when I swipe a page to this watch face page, the speed of animation is too slow. So I want to change the speed of animation faster.
[Q2] And I want to get the current selected page index in swipecontainer. There is a function to set the current page but there is no feature to get the current index.
[Q3] I know there is a source code of swipecontainer but I use touchgfx_core.a and even if I change the source code, it didn't affect it. Can I build touchgfx_core.a by myself after I change the source code?
How can I get a solution about this matter? Do I make my own swipecontainer class like "SwipeContainerEx" as a subclass of the original swipecontainer?
Could you let me know better solutions?
Thanks in advance!!
J.Park
2020-05-22 06:40 AM
Hello,
What do you mean by when you swipe a page it's too slow ? The speed can be changed in the source code or at least the number of steps for the change page animation.
To get the current selected page you need to store it somehow yourself in a variable or even in the Model if you want to remember at which page you were before changing to another screen. There's no function that can give you this information in the swipe container.
Unfortunately, I cannot help you regarding building touchgfx_core.a
/Alexandre
2020-05-24 08:08 PM
Dear Alexandre,
Thank you for your reply.
Summarizing the point of my question,
(Q1) If the page swiping speed is too slow when using the "SwipeContainer" class, what should I do to make it faster?
(Q2) --> No function from your answer.
(Q3) --> I cannot handle it from your answer.
Then, I have to make my own "SwipeContainer" or a subclass of SwipeConainer class to solve (Q1)+(Q2). Right?
Thanks in advance~!
J.Park
2020-05-25 03:54 AM
Hello,
Unfortunately, the variable that specifies the duration of the animation is hardcoded in the corresponding function (animateLeft() and animateRight()).
So even if you create your own class that inherits the SwipeContainer class, you won't be able to affect the speed.
Therefore, the option I can see right now is that you create your own SwipeContainer (basically copy paste everything from the .hpp and .cpp files) and change the value of the variable called duration.
I don't know if you have access to the SwipeContainer.hpp and .cpp files so I will enclose them to this message.
Regarding touchgfx_core.a, we will try to investigate.
/Alexandre
2020-06-07 05:54 PM
Thank you, Alexandre.
I made my own SwipeContainer class with the reference of the original SwipeContainer class code.
Now, I can change the duration of the animation.
Thank you for your advise, it was the perfect guide for solving the problem.
J.Park