Android Question Set Top of Drawer

Andromeda

Member
Licensed User
Longtime User
Hello,

i try to use the B4X Drawer and all is ok, but i cant set the Top of the Drawer. I can set my menupoints down, but i cant set the whole drawer under my Top-Menu. I tried to use "Drawer.leftpanel.top" but with no effect at all. The Drawerpanel always goes from topheight = 0 to the maximum and i want to resize it.
There is a resize command but it seems to just set the width and height but not the top.

my code so far:

B4X:
    Drawer.Initialize(Me, "Drawer", Activity, 250dip)
    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")

I just can rearrange the Layout "1" and the Layout "Left" up and down this Drawerpanel.

Do i have to fiddle it inside the B4XDrawer Class?
 

Andromeda

Member
Licensed User
Longtime User
Try to fiddle with class and change the

B4X:
Private Sub ChangeOffset (x As Float, CurrentlyTouching As Boolean, NoAnimation As Boolean)
    Dim TopMenuheight As Int = 95dip
    .
    .
        mLeftPanel.SetLayoutAnimated(duration, x, TopMenuheight, mLeftPanel.Width, mLeftPanel.Height)
        mDarkPanel.SetLayoutAnimated(0, x, TopMenuheight, mDarkPanel.Width, mDarkPanel.Height)

Can be more professional with TopmenuHeight as parameter in that function but its sufficient for now.
Maybe you consider to implement it in your class?
 
Upvote 0
Top