Android Question ASTabMenu - use in a second activity [solved]

ThePuiu

Active Member
Licensed User
Longtime User
Hi, I downloaded the example and it works perfectly. I tried to use the library in an application that in the main activity has a form for login, and after logging open a second activity (Dashboard).
Here I want to display the bottom menu. No matter what color changes I made, the menu remains just a white strip without any buttons being displayed. The code used is:
B4X:
Sub Process_Globals
    Dim xui As XUI    
End Sub

Sub Globals
    Private bottomMenu As ASTabMenu
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("DashboardLayout")

    bottomMenu.SelectedTabTextColor = Colors.Gray
    
    bottomMenu.AddTab(xui.Color_ARGB(255,55, 255, 255),"Test",bottomMenu.FontToBitmap(Chr(0xF015),False,30,xui.Color_Red),"")
    bottomMenu.AddTab(xui.Color_ARGB(255,55, 255, 255),"Test1",bottomMenu.FontToBitmap(Chr(0xF179),False,30,xui.Color_LightGray),"")
    bottomMenu.AddTab(xui.Color_ARGB(255,55, 255, 255),"Test3",bottomMenu.FontToBitmap(Chr(0xF11B),False,30,xui.Color_LightGray),"")
    bottomMenu.AddTab(xui.Color_ARGB(152,55, 255, 255),"Test4",bottomMenu.FontToBitmap(Chr(0xE859),True,30,xui.Color_LightGray),"")
    
    bottomMenu.CurrentTabUnderlineGravity = bottomMenu.CurrentTabUnderlineGravity_BOTTOMRIGHT
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub bottomMenu_TabClick(index As Int)  
End Sub

Sub rb_underlineanimation_normal_CheckedChange(Checked As Boolean)
    bottomMenu.CurrentTabUnderlineAnimation = bottomMenu.CurrentTabUnderlineAnimation_NORMAL
End Sub
Sub rb_underlineanimation_stretch_CheckedChange(Checked As Boolean)
End Sub
Sub cb_underlinevisible_CheckedChange(Checked As Boolean)
    bottomMenu.CurrentTabUnderline = Checked
End Sub
Sub sp_style_ItemClick (Position As Int, Value As Object)
    bottomMenu.TabStyle = Value
End Sub

Sub Activity_Click
End Sub

Sub cb_partinglinevisible_CheckedChange(Checked As Boolean)
    bottomMenu.PartingLineVisible = Checked
End Sub

Sub sp_gravity_ItemClick (Position As Int, Value As Object)
    bottomMenu.CurrentTabUnderlineGravity = Value
End Sub

Sub sp_badge_gravity_ItemClick (Position As Int, Value As Object)
    bottomMenu.Badge_Gravity = Value
End Sub

In the loaded layout, I copied (copy / paste) the control from the example .

Do you have any idea what I'm not doing well? Thank you!
 

Attachments

  • Screenshot_20200721-134744.jpg
    Screenshot_20200721-134744.jpg
    21.6 KB · Views: 197

ThePuiu

Active Member
Licensed User
Longtime User
I moved the button build code to Main after loading the Dashboard layout and now it works!
My mistake is that I didn't open a second activity but I just uploaded another layout in the first activity .... I apologize for my stupidity.
 
Upvote 0
Top