jfeinstein10 SlidingMenu library

Status
Not open for further replies.

Douglas Farias

Expert
Licensed User
Longtime User
can you use .visible

B4X:
 If smnew.Visible = True Then
smnew.Visible = False
Return
 

gadgetmonster

Active Member
Licensed User
Longtime User
Hi Douglas,

Unfortunately I really need an event to fire to tell me that its been opened. I using the stdactionbar plus the MSMaterialMenu Lib. Everything is fine when the user presses the action bar to open close the menu as I can detect this and the icon changes automatically. However, if the user uses a swipe to open the menu I can't detect this and therefore the action bar icon is incorrect.
 

Douglas Farias

Expert
Licensed User
Longtime User
why dont use a timer? when open the menu = timer start
check every 100 ms if is opned or closed *-*
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
JavaObject to the rescue:
B4X:
 Dim jo As JavaObject = sm
  Dim event As Object = jo.CreateEventFromUI("com.jeremyfeinstein.slidingmenu.lib.SlidingMenu$OnOpenListener", "Open", Null)
  jo.RunMethod("setOnOpenListener", Array(event))
End Sub

Sub Open_Event (MethodName As String, Args() As Object) As Object
   Log("Opened!")
End Sub
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Is there a way to add the same slidingmenu to every activity I have? I read somewhere you could create an activity with the slidingmenu on it and heritate a new activity from this activity, but I don't know if that's possible in B4A.
 

Federico956

Member
Licensed User
Longtime User
Is there a way to add the same slidingmenu to every activity I have? I read somewhere you could create an activity with the slidingmenu on it and heritate a new activity from this activity, but I don't know if that's possible in B4A.
What about a little library with this Sliding Menu ?
 

wimpie3

Well-Known Member
Licensed User
Longtime User
It seems this library has some issues with buttons becoming unresponsive. To test this: put a button on an activity, click on it, it works fine. Now slide a menu open (left or right, doesn't matter) and close it again. Click the button again. Ain't working anymore... :-(
 

wimpie3

Well-Known Member
Licensed User
Longtime User
I was able to find the problem myself. In the manifest file the following should be declared:

B4X:
android:targetSdkVersion="14"

In my case it was "11" and this triggered the bug.
 

phukol

Active Member
Licensed User
Longtime User
Hi guys! Just want to ask how can i implement horizontal scrolling on this sliding menu, because i have items at the bottom of my slider.
 

Myr0n

Active Member
Licensed User
Longtime User
Hi guys

Sorry if I bothers you too much,

Is there a way to add a SlidingMenuWrapper to a panel?

I am trying to implement the slidingMenuWrapper to the " ActionBar / Sliding Pages tutorial" example in every panel.(different slidingMenuWrapper for every panel)

Currently it show the same slidingmenu in all panels.

Thank you in advance.
 
Last edited:

Myr0n

Active Member
Licensed User
Longtime User
Hello guys

Could somebody tell me, how to disable the SlidingMenuWrapper for a while?

I try with:

smWrapper1.Menu.Enabled = False
smWrapper1.Menu.Visible = False
smWrapper1.SecondaryMenu.Enabled = False
smWrapper1.SecondaryMenu.Visible = False

but any of the above parameters does not works.

Is there something that I could get the event when the user try to use the menu?

Thank you
 

Myr0n

Active Member
Licensed User
Longtime User
Oh boy!
At first Thank you so much Erel and second, do you know what? I did it, what I asked in the post #55,
and now there is a different slidingMenuWrapper for every panel.

What did I do?
I modified the sub VP_PageSelected as the next code, and voila!, every panel has a slidingmenuwrapper.
Thank you so much.

B4X:
Sub VP_PageSelected (Position As Int)
    Try
        If bar.SelectedIndex <> Position Then bar.SelectedIndex = Position
    Catch
        Msgbox(LastException,"Error VP_PageSelected")
    End Try
    If Position = 0 Then
        Dim jo As JavaObject = smWrapper1
        jo.RunMethod("setSlidingEnabled", Array(True)) 'or false
        Dim jo As JavaObject = smWrapper2
        jo.RunMethod("setSlidingEnabled", Array(False)) 'or false
    Else    'smWrapper2 for the rest of the tabs, except tab 0
        Dim jo As JavaObject = smWrapper1
        jo.RunMethod("setSlidingEnabled", Array(False)) 'or false
        Dim jo As JavaObject = smWrapper2
        jo.RunMethod("setSlidingEnabled", Array(True)) 'or false
    End If  
End Sub
 

PhilipBrown

Active Member
Licensed User
Longtime User
I am trying to document exactly how the B4A developer is supposed to use #AdditionalRes.
I can't make sliding menus work.
The sample program will compile and run on a physical device, whether #AdditionalRes is included or not, and in either case the screen is blank and the command
sm.Initialize("sm")
seems to fail because no further commands are executed and no menus are shown.
Could we have idiot-proof instructions about exactly what files we are supposed to put in which folders please?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…