2020-05-13 06:43 AM
I have requirements to keep a header bar with a number of status indicators visible on all screens. At first I created a custom component representing the header bar and placed it on all screens. But that is a duplication and any time I change screens, the bar animates with it.
I then tried using swipe containers, but TouchGFX designer crashed with an array index out of bounds error every time I tried to hide the container I'm not editing.
Any insight as to how to maintain a common container for part of the screen on all screens/views?
Solved! Go to Solution.
2020-05-13 11:54 PM
you might find a bit more information here: https://community.st.com/s/question/0D73W000000Pmzq/correct-way-to-bypass-cumbersome-mvc-logic
if you want to have a single item to refer to on all screens.
As for the 're-animation' you can work around that:
each presenter have a constructor called 'activate'. that method is called before the screen is shown so you can set values and states of statusbars and buttons there (forward the changes to the view). The method you call in the view will have a call to 'invalidate' of each particular item you need to draw and they will be invalid before the view is shown, hence you will not see the animation sequence (if I understood you correctly)
The downside is that you need to call the update function in all your screens but that can be done reasonably effective anyway.
2020-05-13 07:11 AM
I believe I figured out part of the problem. Instead of selecting which page I wanted to view in the options to the right on the swipe container, I was trying to use the Send Front and Send Backward commands. I am now using a single screen with a portion dedicated to a Swipable Container.
2020-05-13 11:54 PM
you might find a bit more information here: https://community.st.com/s/question/0D73W000000Pmzq/correct-way-to-bypass-cumbersome-mvc-logic
if you want to have a single item to refer to on all screens.
As for the 're-animation' you can work around that:
each presenter have a constructor called 'activate'. that method is called before the screen is shown so you can set values and states of statusbars and buttons there (forward the changes to the view). The method you call in the view will have a call to 'invalidate' of each particular item you need to draw and they will be invalid before the view is shown, hence you will not see the animation sequence (if I understood you correctly)
The downside is that you need to call the update function in all your screens but that can be done reasonably effective anyway.