Android Question B4X Drawer SlidingMenu

Sinan Tuzcu

Well-Known Member
Licensed User
Hi,
is there an option to change the Z-Order of LeftMenu?
Because I have created a dynamic scrollview on the Main Activity and if I open the Left menu, then the left menu slide under the scrollview.

BR
Sinan
 

Sinan Tuzcu

Well-Known Member
Licensed User
Unfortunately not.
there is only
1629497739318.png
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
That happens if I create the scroll view dynamic only

And this

Drawer.LeftPanel.BringToFront

doesn't works
 
Last edited:
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region
    #Extends: android.support.v7.app.AppCompatActivity
Sub Process_Globals
    
End Sub

Sub Globals
    Private ACToolBarLight1 As ACToolBarLight
    Private ToolbarHelper As ACActionBar
    Private Drawer As B4XDrawer
    Private ListView1 As ListView
    Private ScrollView1 As ScrollView
    Private Button1 As Button
    
End Sub

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
    
    ScrollView1.Initialize(100dip)
    ScrollView1.Color=Colors.White
    Activity.AddView(ScrollView1, 5dip, Button1.Top + Button1.Height, 70%x - 10dip, 70%y - (Button1.Top + Button1.Height))
    
    Drawer.LeftPanel.BringToFront
End Sub

Sub ACToolBarLight1_NavigationItemClick
    Drawer.LeftOpen = Not(Drawer.LeftOpen)
End Sub

Sub Activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK And Drawer.LeftOpen Then
        Drawer.LeftOpen = False
        Return True
    End If
    Return False
End Sub


Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
WhatsApp Image 2021-08-21 at 03.06.42.jpeg

pls see in attachment
 

Attachments

  • AppCompat.zip
    11.6 KB · Views: 36
Upvote 0

Alexander Stolte

Expert
Licensed User
Activity.AddView(ScrollView1, 5dip, Button1.Top + Button1.Height, 70%x - 10dip, 70%y - (Button1.Top + Button1.Height))
instead of this:
B4X:
Activity.AddView(ScrollView1, 5dip, Button1.Top + Button1.Height, 70%x - 10dip, 70%y - (Button1.Top + Button1.Height))
make this:
B4X:
Drawer.CenterPanel.AddView(ScrollView1, 5dip, Button1.Top + Button1.Height, 70%x - 10dip, 70%y - (Button1.Top + Button1.Height))
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Hi,

how can do this in this case?
B4X:
accord.Initialize(Me,"accord")
accord.AddToParent(Activity,0dip,Label1.height + Label1.Top,100%x,100%y - Panel1.height)
accord.addPanel(41dip, 290dip, createPanel("Settings",Colors.ARGB(255,255,255,255),0))


I have do this
Drawer.CenterPanel.Parent.AddView(accord,0dip,Label1.height + Label1.Top,100%x,100%y - Panel1.height)
but I get an error
 
Upvote 0
Top