B4A Library [Class] SlideMenu

This is a class that implements a sliding menu as seen in many apps like Google+, Evernote, Facebook etc.

Requires B4A 2.0 or newer.
 

Attachments

  • SlideMenuClass_1_0.zip
    12.6 KB · Views: 5,158
  • screenshot-1340094419260.png
    screenshot-1340094419260.png
    32.3 KB · Views: 6,447

stevel05

Expert
Licensed User
Longtime User
Very nice, great contemporary feel.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Tried to make it appear left or right but animation is not my strongest point :)

Want to use it as a replacement for the Quick vertical menu together with the actionbar. That will probably solve my issues without the need for libraries.

Could you add either left or right top?
 

pluton

Active Member
Licensed User
Longtime User
This is soooooo great. I love it

I must learn class programming ASAP. This is fantastic.

Thanks for sharing it.
 

salmander

Active Member
Licensed User
Longtime User
Excellent work mate.... Just to let you know, there is a bug, if the keyboard is open, and you press the menu key, the SlideMenu behaves unexpectedly. It shows the menu, but no click event get registered.
 

Merlot2309

Active Member
Licensed User
Longtime User
Hi Corwin,

Thank you for this nice example.
I will use it as a starting point for Classes.

Regards,
Helen.
 

PHB2

Member
Licensed User
Longtime User
Very nice indeed. It scrolls properly when a large number of items are added to it.
 

mrB

New Member
Licensed User
Longtime User
Excellent work mate.... Just to let you know, there is a bug, if the keyboard is open, and you press the menu key, the SlideMenu behaves unexpectedly. It shows the menu, but no click event get registered.

I had a similar problem. After three clicks the events stopped being registered.

Just after

B4X:
   mBackPanel.BringToFront
   mSlidePanel.BringToFront

I added

B4X:
   mListView.BringToFront

That solved my problem.

See line 81,82 in the class.

Thanks for a great class!
 

salmander

Active Member
Licensed User
Longtime User
I had a similar problem. After three clicks the events stopped being registered.

Just after

B4X:
   mBackPanel.BringToFront
   mSlidePanel.BringToFront

I added

B4X:
   mListView.BringToFront

That solved my problem.

See line 81,82 in the class.

Thanks for a great class!
cheers mate. That did indeed solved the problem.
 

JonPM

Well-Known Member
Licensed User
Longtime User
Can someone confirm a bug for me? To reproduce:
Set one of the Item's to start a separate activity
Open Menu
Select Item (opens new activity)
Go back to first activity
Open Menu

On my device the menu will open and close really fast. I have to press menu once again in order to open and use it. I am assuming something needs to go in Activity_Resume, just not sure what exactly. Anyone?
 

JonPM

Well-Known Member
Licensed User
Longtime User
Can someone confirm a bug for me? To reproduce:
Set one of the Item's to start a separate activity
Open Menu
Select Item (opens new activity)
Go back to first activity
Open Menu

On my device the menu will open and close really fast. I have to press menu once again in order to open and use it. I am assuming something needs to go in Activity_Resume, just not sure what exactly. Anyone?

Ahh, I seemed to have found the problem.

sm.IsVisible doesn't get set to false when opening a new activity. This is my temp fix until someone can comment on this:

In SlideMenu class add:
B4X:
Public Sub SetVisible (Visible As Boolean)
   mSlidePanel.Visible = Visible
End Sub

In main activity, under Activity_Pause add:
B4X:
sm.SetVisible(False)

This does the trick, but maybe someone has a better way?
 

Yafuhenk

Active Member
Licensed User
Longtime User
Hi

I like the slide menu so I included it in my app. However the software crashes now. I included the code that JonPM suggested.

To get an crash do the following:
- download slidemenucrash.zip
- start app
- open the menu
- slowly (!!) press on the Screenshot - or About & Help item

The strange thing is that when you click the item very fast it all goes well.

Can some one help me here?

Thanks

Henk
 

Informatix

Expert
Licensed User
Longtime User
Hi

I like the slide menu so I included it in my app. However the software crashes now. I included the code that JonPM suggested.

To get an crash do the following:
- download slidemenucrash.zip
- start app
- open the menu
- slowly (!!) press on the Screenshot - or About & Help item

The strange thing is that when you click the item very fast it all goes well.

I get no crash with the About & Help item.
The width of you slide menu is not enough for my screen (854x480). You should define it in dips instead of %.
 

Yafuhenk

Active Member
Licensed User
Longtime User
Informatx, touch the help & about item for about 1 second. What happens then?

Henk
 
Top