cancel
Showing results for 
Search instead for 
Did you mean: 

Touch GFX 'Status Bar' at Top of all views

savvn001
Associate II

Hi, I want to know how to implement a 'status bar' type view that is at the top of all views, that contains things like battery level etc. similar to that found in something like Android or iOS.

In the touch GFX documentation it mentions it briefly but does not elaborate much on how to implement this in code:

"If for instance all your screens need to display a status bar at the top, showing current time, battery level, et cetera you can create a base view class containing the status bar only and have all your views deriving from this class, so you get the status bar functionality automatically"

2 REPLIES 2
HP
Senior III

You can create a custom container for this.

If you set the size to for example the width of the screen and 10-16 pixels high you can add all the items you want to that container.

All you need to do is add the custom container to all your screens afterwards.

Hi, I actually did this intially, but could not figure out how to be able to interact with the elements in the container. I had worked out something along the lines of, defining a function in the model listener which I can override in the status bar container class, but as the container is not init with a view & presenter I couldn't work out what to do from there. Was I along the right path?