Android Question how to fit panel size inside drawer.centerpanel in apcompat?

ardillaprogramadora

Member
Licensed User
Hello i am using appcompat:

1.bal: panel1, ACToolbarLight1. Content panel:

BfFWujS.png


B4X:
Sub Activity_Create(FirstTime As Boolean)
    Drawer.Initialize(Me, "Drawer", Activity, 300dip)
    Drawer.CenterPanel.LoadLayout("1")
    
    ToolbarHelper.Initialize
    ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow
    Dim bd As BitmapDrawable
    bd.Initialize(LoadBitmap(File.DirAssets, "hamburger.png"))
    ToolbarHelper.UpIndicatorDrawable =  bd
    ACToolBarLight1.InitMenuListener
    Drawer.LeftPanel.LoadLayout("Left")
    For i = 1 To 30
        ListView1.AddSingleLine("Item " & i)
    Next

So far so good, left panel works, everything works.

My problem is when i try to load another layout inside Contentpanel:

B4X:
contentpanel.RemoveAllViews
contentpanel.LoadLayout("data")

in the "data" layout there is a simple panel, its size should be the same of the contentpanel, but it isnt
I tried to set the new panel inside "data" layout with datapanel.height = contentpanel.height and datapanel.Width= contentpanel.Width. Tried too with Drawer.CenterPanel and activity.height and width, but it does not work, it always looks like this:

DcEUA8e.png


the white background panel is datapanel and the grey is contentpanel, how can i make datapanel the size contentpanel is?
 
Top