Android Question B4XDrawer issue with elevation

DBernaert

Member
Licensed User
Hi,

I'm using B4XDrawer which is working great.
If I'm using elevation on a panel in a B4XPage, the panel says visible over the B4XDrawer (see screenshots).
How can this be prevented?

Thanks.
 

Attachments

  • 1000004589.jpg
    1000004589.jpg
    344.8 KB · Views: 44
  • 1000004590.jpg
    1000004590.jpg
    390.9 KB · Views: 52

DBernaert

Member
Licensed User
Tried it without luck.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("Main")
    B4XPages.SetTitle(Me, "WAVEDESK ERP")
    
    Drawer.Initialize(Me, "Drawer", Root, 250dip)
    Drawer.CenterPanel.LoadLayout("Main")
    Drawer.LeftPanel.LoadLayout("Menu")
    
    #If B4i
    HamburgerIcon = xui.LoadBitmapResize(File.DirAssets, "hamburger.png", 32dip, 32dip, True)
    #End if
    
    #If B4a
    HamburgerIcon = xui.LoadBitmapResize(File.DirAssets, "hamburger_black.png", 32dip, 32dip, True)
    #End If
    
    #if B4i
    Dim bb As BarButton
    bb.InitializeBitmap(HamburgerIcon, "hamburger")
    B4XPages.GetNativeParent(Me).TopLeftButtons = Array(bb)
    #end if
    
    'Get the details of the user
    Dim j As HttpJob
    
    j.Initialize("", Me)
    j.Download(Main.BaseUrl & "users/details")
    j.GetRequest.SetHeader("Authentication", "bearer " & Main.Token)
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Dim parser As JSONParser
        parser.Initialize(j.GetString)
        Dim jRoot As Map = parser.NextObject
        LblUserName.Text = jRoot.Get("firstname") & " " & jRoot.Get("name")
        LblUserEmail.Text = jRoot.Get("email")
        Main.UserId = jRoot.Get("id")
        Main.User_access_article_list = jRoot.Get("access_article_list")
        j.Release
    Else
        LblUserName.Text = ""
        LblUserEmail.Text = ""
        j.Release
    End If
    
    Build_menu
    
    Drawer.LeftPanel.BringToFront
 
Upvote 0

PaulMeuris

Active Member
Licensed User
The default elevation level of the drawer leftpanel is 4dip.
You can find this in the source code of the B4XDrawer:
Initialize method of B4XDrawer:
    #if B4A
    Dim p As Panel = mLeftPanel
    p.Elevation = 4dip
The test i did with 3 panels having an elevation level less than 4dip did not work.
Even when you change the elevation level in code to a higher elevation level:
B4X:
    drawer.LeftPanel.As(Panel).Elevation = 10dip
Here are some images showing the result of the test:
1695532638807.png
1695532717276.png
1695532771256.png

Panel 1 (red panel) has an elevation level set to 3dip
Panel 2 (green panel) has an elevation level set to 2dip
Panel 3 (blue panel) has an elevation level set to 1dip
You can find the source code in the attachment.
Conclusion: don't use elevation levels unless you absolutely have to... or wait for an update of the B4XDrawer library that resolves this issue...
 

Attachments

  • testenvironment36.zip
    11.5 KB · Views: 38
Upvote 0
Top