After reading the threads about wonderful WobbleMenu i'm trying to make it work with B4XPages.
I am totally lost. Nothing seems to work correct. I have trouble showing the correct tab when i'm clicking it and trouble with back button of every B4XPage.
Bellow i have a small demonstration project with mainPage and 2 additional B4XPages if someone can advice/help me.
In every page i have almost the same code:
I am totally lost. Nothing seems to work correct. I have trouble showing the correct tab when i'm clicking it and trouble with back button of every B4XPage.
Bellow i have a small demonstration project with mainPage and 2 additional B4XPages if someone can advice/help me.
In every page i have almost the same code:
MainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
pg1.Initialize
B4XPages.AddPage("pg1", pg1)
pg2.Initialize
B4XPages.AddPage("pg2", pg2)
WobbleMenu1.SetTabTextIcon(1,"Main Page", Chr(0xE3D0), Typeface.MATERIALICONS)
WobbleMenu1.SetTabTextIcon(2,"Page 1", Chr(0xE3D1), Typeface.MATERIALICONS)
WobbleMenu1.SetTabTextIcon(3,"Page 2", Chr(0xE3D2), Typeface.MATERIALICONS)
WobbleMenu1.SetCurrentTab2(1, False)
SetWobbleMenuPosition(WobbleMenu1, 1)
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub SetWobbleMenuPosition(wm As WobbleMenu, thisTab As Int)
If wm.GetCurrentTab <> thisTab Then
wm.SetCurrentTab2(thisTab, False)
End If
End Sub
Sub WobbleMenu1_Tab1Click
B4XPages.ShowPage("MainPage")
End Sub
Sub WobbleMenu1_Tab2Click
B4XPages.ShowPage("pg1")
End Sub
Sub WobbleMenu1_Tab3Click
B4XPages.ShowPage("pg2")
End Sub
B4xPage1:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("pg1")
WobbleMenu1.SetTabTextIcon(1,"Main Page", Chr(0xE3D0), Typeface.MATERIALICONS)
WobbleMenu1.SetTabTextIcon(2,"Page 1", Chr(0xE3D1), Typeface.MATERIALICONS)
WobbleMenu1.SetTabTextIcon(3,"Page 2", Chr(0xE3D2), Typeface.MATERIALICONS)
WobbleMenu1.SetCurrentTab2(2, False)
SetWobbleMenuPosition(WobbleMenu1, 2)
End Sub
Sub SetWobbleMenuPosition(wm As WobbleMenu, thisTab As Int)
If wm.GetCurrentTab <> thisTab Then
wm.SetCurrentTab2(thisTab, False)
End If
End Sub
Sub WobbleMenu1_Tab1Click
B4XPages.ShowPage("MainPage")
End Sub
Sub WobbleMenu1_Tab2Click
B4XPages.ShowPage("pg1")
End Sub
Sub WobbleMenu1_Tab3Click
B4XPages.ShowPage("pg2")
End Sub