Android Question SlideMenue B4XDrawer

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hello all,

i use the slidemenue from this side:
https://www.b4x.com/android/forum/threads/b4x-b4xdrawer-sliding-drawer.97828/page-2

it works also very well. But somthing is wrong. I am not able to put the MenueBar on the Top.
See picture:
upload_2019-2-26_3-45-35.png

How can I do it?

The Scrollview wich included Togglebuttons, will created by dynamic.

I need help.

thanks in advance
Sinan
 

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hi Erel,

how can I set the Elevation on 4dip?

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Activity.LoadLayout("front_01")
    Drawer.Initialize(Me, "Drawer", Activity, 300dip)
    Drawer.CenterPanel.LoadLayout("front_01")
    ToolbarHelper.Initialize
    ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow
    Dim bd As BitmapDrawable
    bd.Initialize(LoadBitmap(File.DirAssets, "striche.png"))
    ToolbarHelper.UpIndicatorDrawable =  bd
    ACToolBarLight1.InitMenuListener
    Drawer.LeftPanel.LoadLayout("Left")
    
    
    ListView1.AddSingleLine("Input/Output")
    ListView1.AddSingleLine("All ON/OFF")
    ListView1.AddSingleLine("Settings")
    ListView1.AddSingleLine("Disconnected")
    
    
    
        
    'chkTimeOut.Checked = Variablen.YM_TimeOutChecked
    Variablen.chkTimeOut_Checked = Variablen.YM_TimeOutChecked
End Sub
 
Upvote 0

thetahsk

Active Member
Licensed User
Longtime User

Change your B4XDrawer.bas.

B4X:
Public Sub Initialize (Callback As Object, EventName As String, Parent As B4XView, SideWidth As Int)
    mEventName = EventName
    mCallBack = Callback
    mSideWidth = SideWidth
    #if B4A
    Dim creator As TouchPanelCreator
    mBasePanel = creator.CreateTouchPanel("base")
    #else if B4i
    mBasePanel = xui.CreatePanel("")
    Dim nme As NativeObject = Me
    Dim no As NativeObject = mBasePanel
    no.RunMethod("addGestureRecognizer:", Array(nme.RunMethod("CreateRecognizer", Null)))
    #End If
    Parent.AddView(mBasePanel, 0, 0, Parent.Width, Parent.Height)
    mCenterPanel = xui.CreatePanel("")
    mBasePanel.AddView(mCenterPanel, 0, 0, mBasePanel.Width, mBasePanel.Height)
    mDarkPanel = xui.CreatePanel("dark")
    mBasePanel.AddView(mDarkPanel, 0, 0, mBasePanel.Width, mBasePanel.Height)
    mLeftPanel = xui.CreatePanel("LeftPanel")
    mBasePanel.AddView(mLeftPanel, -SideWidth, 0, SideWidth, mBasePanel.Height)
    mLeftPanel.Color = xui.Color_Red
    #if B4A
    Dim p As Panel = mLeftPanel
    p.Elevation = 4dip        <-------------------------------------------------
    #Else If B4i
    Dim p As Panel = mDarkPanel
    p.UserInteractionEnabled = False
    p.SetBorder(0, 0, 0)
    p = mLeftPanel
    
    p = mCenterPanel
    p.SetBorder(0, 0, 0)
    p = mBasePanel
    p.SetBorder(0, 0, 0)
    #End If
End Sub
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
The scrollview which containing the toggle buttons is loaded dynamically. Hince İ think that the elevation 0 will have.
 
Upvote 0
Top