jfeinstein10 SlidingMenu library

Status
Not open for further replies.

Douglas Farias

Expert
Licensed User
Longtime User
@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+ ?
 

asales

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

B4X:
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

  • jslidingmenu_customlv.zip
    8.5 KB · Views: 544

Douglas Farias

Expert
Licensed User
Longtime User
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?


B4X:
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:

Douglas Farias

Expert
Licensed User
Longtime User
really the clv.asview dont work *-* need to talk with erel =(
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You need to first add the clv to its parent and then add the items:
B4X:
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
 

gadgetmonster

Active Member
Licensed User
Longtime User
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
 

gadgetmonster

Active Member
Licensed User
Longtime User
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.
Top