I try to understand your question.
I am not sure you are confused with the
show new page or the
show/hide menu panels.
I assume the former.
First of all, this template is a little bit different from the ordinary B4XPages template.
It is based on
this example by Erel.
B4XPages maybe more simpler.
Instead of adding new B4XPage, this template uses
standard class with a Show method set as Public.
Public Sub Show (Parent As B4XView)
When the caller form (B4XMainPage or Form) opens a new page from a user click action on a menu, we first check PnlCenter (panel used for displaying the layout) is empty or already loaded with another layout.
Private Sub ClvMenuMini_ItemClick (Index As Int, Value As Object)
If ContentEmpty = False Then PnlCenter.GetView(0).RemoveViewFromParent
CallSub2(Value, "Show", PnlCenter)
End Sub
The ContentEmpty sub checks for any views are added to the PnlCenter.
Private Sub ContentEmpty As Boolean
Return PnlCenter.NumberOfViews = 0
End Sub
If it is not empty, we need to remove the existing "layout" so we can load a new layout to the same "container" again.
PnlCenter.GetView(0).RemoveViewFromParent
Then we use CallSub2 to call the Show sub in class Form1 by passing the parameter PnlCenter as the Parent view.
CallSub2(Value, "Show", PnlCenter)
You can see in Form 1, the Show sub is:
Public Sub Show (Parent As B4XView)
The Component value passed to CallSub2 is an Object type Form1 that we added when we create the items for CustomListView (ClvMenuMini).
Dim frm1 As Form1
frm1.Initialize
ClvMenuMini.Add(CreateMiniItem(Chr(0xF004), ClvMenuMini.AsView.Width), frm1)
That's it.
I hope I have explained well.