[B4X] [XUI] AS Tab Menu (Bottom Menu/Navigation)

Rubsanpe

Active Member
Licensed User
Sorry, i changed in B4A the Border Color=#000000, Border Width=1 and Corner Radious=10 and i can't see neither change on screen.

Rubén
 

Rubsanpe

Active Member
Licensed User

Ok thanks, I have seen the problem now. It does not apply the chosen color to the border of the control. It uses a very light gray and on a white background it is not visible. If I put a dark color below the control then the trimmed border shows correctly.

Designer control configuration
cfg Designer.PNG

White background
Fondo blanco.PNG

Black background
Fondo Negro.PNG


Thanks

Rubén
 

Alexander Stolte

Expert
Licensed User
Longtime User
The problem is that the corner radius is hidden by the tab panel because it is on top. What I could do is add a padding that keeps the tabs left, right top and bottom space free for the border.
 

Rubsanpe

Active Member
Licensed User
Hi. No problem for me. I only want tell you it. I changed menú background color and it look great. Thank you.

Rubén
 

AlexMaa

Member
Licensed User
Longtime User
IF disable - ASTabMenu_horizontal.TabStripMode = false!
When you click on the second menu - the bar - is not displayed correctly!
error2.png
 

AlexMaa

Member
Licensed User
Longtime User
I suspect there is a mistake somewhere here? although I may be wrong.


B4X:
            If g_TabStripMode = False Then
        
                Dim tmp_top As Float = xlbl_text.Top + xlbl_text.Height
                If g_TabStyle = "Text" Or g_TabStyle = "TextIcon" Then 'only Text or text and icons
                    Dim textwidth As Int =  Max(1dip,MeasureTextWidth(xlbl_text.Text,xlbl_text.Font))
            
                    If g_CurrentTabUnderlineGravity <> getCurrentTabUnderlineGravity_BOTTOMRIGHT Then
                        If g_TabStyle = "TextIcon" Then
                            tmp_top = xpnl_targettab.Height/2 - icon_height/2
                        Else
                            tmp_top = xpnl_targettab.Height/2 - xlbl_text.Height/2
                        End If
                    End If
                    
--->                    xpnl_underline.SetLayoutAnimated(g_CurrentTabUnderlineAnimationDuration,xpnl_targettab.Left + xpnl_targettab.Width/2 - textwidth/2,tmp_top,textwidth,ul_height)
                Else If g_TabStyle = "Icon" Then 'only Icon
                    If g_CurrentTabUnderlineGravity = getCurrentTabUnderlineGravity_BOTTOMRIGHT Then
                        tmp_top = xpnl_tabbase.Height/2 + 15dip
                    Else
                        tmp_top = xpnl_tabbase.Height/2 - icon_height/2.5
                    End If
                    xpnl_underline.SetLayoutAnimated(g_CurrentTabUnderlineAnimationDuration,xpnl_targettab.Left + xpnl_targettab.Width/2 - underlinewidthbyonlyicon/2,tmp_top,underlinewidthbyonlyicon,ul_height)
                End If
 

Lello1964

Well-Known Member
Licensed User
Longtime User
[SOLVED] This lib doesn't work with B4A rel. #11 Beta.
 
Last edited:

Daica

Active Member
Licensed User
I think I found a "bug" with the library.
If you do these steps, the menu's TabClick event will fire, even if you do not click it

1. Add Items to the menu (more than 1)
2. Click on any item that is not the first item
3. Remove all items from menu
4. Add items back
5. Click event will fire, even though user is not physically clicking on menu.

SCTEY6N.gif


Maybe you could do a "ignore event" option?
AsTabMenu1.IgnoreClickEvent = True or something? not sure :p
 

Daica

Active Member
Licensed User
Right Premium Deluxe would be to pack the project from the gif still in the attachment, then I save at least time until I am on this stand ^^

Attached, sorry I thought I had attached it.

In the project, I added my "fix" to it. You can remove the line "ASTabMenu1.IgnoreClickEvent = True" to see what I mean like the GIF.
I'm a noob so my "fix" is simple, but would prefer an actual fix from the creator :D
 

Attachments

  • Project.zip
    22.3 KB · Views: 222
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.23
    • Add BeginUpdate - Call this if you remove or add tabs, no events or animations during this
    • Add EndUpdate - Call this if you finished adding or removing tabs
    • BugFixes
Example:
B4X:
ASTabMenu1.BeginUpdate
ASTabMenu1.RemoveAllTabs
ASTabMenu1.AddTab(Colors.RGB(18, 21, 61),"Item 1",ASTabMenu1.FontToBitmap(Chr(0xE56A),True,40,xui.Color_White),"")
ASTabMenu1.AddTab(Colors.RGB(18, 21, 61),"Item 2",ASTabMenu1.FontToBitmap(Chr(0xE3B0),True,40,xui.Color_White),"")
ASTabMenu1.AddTab(Colors.RGB(18, 21, 61),"Item 3",ASTabMenu1.FontToBitmap(Chr(0xE5C9),True,40,xui.Color_White),"")
ASTabMenu1.EndUpdate

I'm a noob so my "fix" is simple, but would prefer an actual fix from the creator :D
I work full time with vb.net and use the devexpress framework, there it works with "BeginUpdate" and "EndUpdate" when you change things, so I added that too.
 
Top