Android Question ClsSlidingSidebar how to add customlistview to it ?

Addo

Well-Known Member
Licensed User
i am trying to make a customlistview in a sidebar swipe i have used this library

https://www.b4x.com/android/forum/threads/class-slidingsidebar.21533/page-3#post-184738

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim PanelWithSidebar As ClsSlidingSidebar
    Private usrclv As CustomListView
    
End Sub


'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("layout1")
   
    ' Sidebar initialization
    PanelWithSidebar.Initialize(Activity, 200dip, 0, 0, 400, 400)
    PanelWithSidebar.SetOnChangeListeners(Me, "Sidebar_onFullyOpen", "Sidebar_onFullyClosed", "Sidebar_onMove")

    ' Padding removal of the jog_tab_bar drawable
    Dim r As Reflector
    r.Target = PanelWithSidebar.Sidebar
    r.RunMethod4("setPadding", Array As Object(0, 0, 0, 0), Array As String("java.lang.int", "java.lang.int", "java.lang.int", "java.lang.int"))



   
PanelWithSidebar.Sidebar.AddView(usrclv, 20dip, 20dip, PanelWithSidebar.Sidebar.Width - 40dip, PanelWithSidebar.Sidebar.Height - 40dip)
   

End Sub



i couldn't add usrclv because its not considers as a view . i could use usrclv.AsView but this will make the customlistview unclickable .

the demo it self add every thing problematically doesn't use layouts and clv has to be in layout

i wonder how do i add customlistview to this ClsSlidingSidebar
 

Informatix

Expert
Licensed User
Longtime User
i am trying to make a customlistview in a sidebar swipe i have used this library

https://www.b4x.com/android/forum/threads/class-slidingsidebar.21533/page-3#post-184738

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim PanelWithSidebar As ClsSlidingSidebar
    Private usrclv As CustomListView
   
End Sub


'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("layout1")
  
    ' Sidebar initialization
    PanelWithSidebar.Initialize(Activity, 200dip, 0, 0, 400, 400)
    PanelWithSidebar.SetOnChangeListeners(Me, "Sidebar_onFullyOpen", "Sidebar_onFullyClosed", "Sidebar_onMove")

    ' Padding removal of the jog_tab_bar drawable
    Dim r As Reflector
    r.Target = PanelWithSidebar.Sidebar
    r.RunMethod4("setPadding", Array As Object(0, 0, 0, 0), Array As String("java.lang.int", "java.lang.int", "java.lang.int", "java.lang.int"))



  
PanelWithSidebar.Sidebar.AddView(usrclv, 20dip, 20dip, PanelWithSidebar.Sidebar.Width - 40dip, PanelWithSidebar.Sidebar.Height - 40dip)
  

End Sub



i couldn't add usrclv because its not considers as a view . i could use usrclv.AsView but this will make the customlistview unclickable .

the demo it self add every thing problematically doesn't use layouts and clv has to be in layout

i wonder how do i add customlistview to this ClsSlidingSidebar
If you want to replace the listview in the example by a layout of your choice then call PanelWithSidebar.Sidebar.LoadLayout("your_layout"). Sidebar is just a panel.
 
Upvote 0
Top