Android Question B4XPages with cross-page navigation

johnmie

Active Member
Licensed User
Longtime User
Having been convinced by Erel to move to B4Xpages I am trying to port my current project to pages,
BUT I don't know how to implement my (simple) navigation buttons:

My app uses 5+5 pages and navigation buttons as on the left side of the enclosed picture. Clicking on the first one opens a second navigation bar above (right side) for the additional list pages. Thus all pages are always quickly accessible from anywhere.

Navi-ext.png
How can I show these 2 navigation panels on every page while still showing the rest of the page and without duplicating the full btnPage_Click Sub? Today they are part of the main page and the activity height of the other pages is reduced. Is this also possible under pages or would a separate class do the trick, if so how?

Thanks for your help.

Brest, john m.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Today they are part of the main page and the activity height of the other pages is reduced.
Sounds like a bad solution.

1. A separate class is a good option. Implement what ever you can inside the class and reuse it in each of the pages.
2. Another option is to take the panel from the previous page and move it to the next page. It is simpler than it sounds.
3. If you aren't interested in cross platform solution, then you can exploit(?) the fact that all pages are inside the same activity and add the bar to the Main activity. Set its elevation to 20dip. It will show above all other pages.

I would have chosen 1 or 2 though 3 is also fine.
 
Upvote 0
Top