cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep the same header bar for all screens?

PChil.1
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
HP
Senior III

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.

View solution in original post

2 REPLIES 2
PChil.1
Associate II

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.

HP
Senior III

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.