jfeinstein10 SlidingMenu library

Status
Not open for further replies.
@Erel how to add the title click like a jfeinstein video?

its possible add the click at title and open the slide menu?
and its possible use on android 3.0+ ?
 
I try to add a CustomListViewt in JSlidingMenu but I receive the error java.lang.NullPointerException.
What am I doing wrong?

Code: Copy
Sub Globals
    Dim sm As SlidingMenu

    Dim clv1 As CustomListView   
End Sub

Sub Activity_Create(FirstTime As Boolean)
      sm.Initialize("sm")
      Dim offset As Int = 100dip
      sm.BehindOffset = offset
      sm.Mode = sm.BOTH
   
    clv1.Initialize(Me, "clv3")
   
      For i = 1 To 10
     clv1.AddTextItem("Action "&i, "a")
      Next

   sm.Menu.AddView(clv1.AsView, 10dip, 60dip, 100%x - offset - 20dip, 50dip)
End Sub
 

Attachments

I try to add a CustomListViewt in JSlidingMenu but I receive the error java.lang.NullPointerException.
What am I doing wrong?

why you dont add the clv on panel and put a panel on jf?


Code: Copy
Sub GlobalsDim
sm As SlidingMenu
Dim clv1 As CustomListView
End Sub

Sub Activity_Create(FirstTime AsBoolean)
    smnew.Initialize("smnew")
    Dim offset As Int = 20%x
    smnew.BehindOffset = offset
    smnew.Mode = smnew.BOTH

    Private panelmenu As Panel
    panelmenu.Initialize("")
    smnew.menu.AddView(panelmenu, 0, 0, 100%x - offset, 100%y)

clv1.Initialize(Me, "clv3")
For i = 1To10
clv1.AddTextItem("Action "&i, "a")
Next

panelmenu.AddView(clv1.AsView, 0 , 0 , 100%x, 100%y)
end sub
 
Last edited:
really the clv.asview dont work *-* need to talk with erel =(
 
You need to first add the clv to its parent and then add the items:
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
     sm.Initialize("sm")
     Dim offset As Int = 100dip
     sm.BehindOffset = offset
     sm.Mode = sm.BOTH
   
   clv1.Initialize(Me, "clv3")
   sm.Menu.AddView(clv1.AsView, 10dip, 60dip, 100%x - offset - 20dip, 100%y)
     For i = 1 To 10
  clv1.AddTextItem("Action "&i, "a")
     Next
End Sub
 
Hi Erel

Many thanks for this addition to B4a. I have two questions which I hope you can answer:

1. Is there anyway of making the activity fade when the sliding menu opens?
2. I am using the stdActionBar in conjunction with the sliding menu but my menu pushes the action bar to the side as well. Is there a way I can prevent this from happening?

Many thanks
 
Hi Erel

According to the documentation there is a property called SetSlidingActionBarEnabled which I believe is True by default. Setting this to false would cause the sliding menu to appear over the activity as per Material Design. However, this property does not appear to be exposed in the wrapper. I have tried to call it using Java Object but it doesn't find it.
 
Status
Not open for further replies.
Back
Top