B4A Library [Class] SlidingSidebar

Informatix

Expert
Licensed User
Longtime User

"popup_inline_error" is a system drawable. If you use ICS, the drawable provided with ICS is used (in this case, it is not different from the Gingerbread one). To select another system drawable, change the drawable name. You can also create and load your own drawable, as you do with any background.

 

susu

Well-Known Member
Licensed User
Longtime User
I want to mix your SlidingDrawer and SlidingMenu to make a top center button that can drag down or click on it to slide down a menu. I'm confused about PanelWithSidebar.SetOpenCloseButton and PanelWithSidebar.AddOpenCloseHandle, which one I need to use or I need to use both?
 

Informatix

Expert
Licensed User
Longtime User

Since the class consumes the touch event for the handle, you cannot catch the click event. You have to modify the class. Replace "return true" at line #557 by "return false" and add a click event to your handle. In the SlidingDrawer demo, that means two changes:
- ivHandle.Initialize("") becomes ivHandle.Initialize("MyButton")
- an event handler is added:
B4X:
Sub MyButton_Click
   If Not(PanelWithSidebar.IsSidebarVisible) Then
      PanelWithSidebar.OpenSidebar
   End If
End Sub
 

susu

Well-Known Member
Licensed User
Longtime User
It works perfectly. Thank you so much

I add two lines to auto slide up the sidebar when click on button.
Sub MyButton_Click
If Not(PanelWithSidebar.IsSidebarVisible) Then
PanelWithSidebar.OpenSidebar
Else
PanelWithSidebar.CloseSidebar
End If
End Sub
 

worm

Member
Licensed User
Longtime User
Really nice Class :sign0142:

I've just a question: it is possible to add two SlidingSidebars (ex: one left and one right)?

ps: donation on the way :sign0188:
 

Informatix

Expert
Licensed User
Longtime User
Really nice Class :sign0142:

I've just a question: it is possible to add two SlidingSidebars (ex: one left and one right)?

ps: donation on the way :sign0188:

Thank you for your donation.

The class is not designed to accept two sidebars, but maybe you can achieve this by adding a second sidebar into the first (each sliding group is a group of two panels). Never tried.
 

metrick

Active Member
Licensed User
Longtime User
Informatix:
How can I clear the sidebar(lvMenu list) before update with new lvMenu list? I have tried lvMenu.Clear and lvMenu.Invalidate did not clear previous list contents.
Thanks.
 

metrick

Active Member
Licensed User
Longtime User
lvmenu.clear is good. It was my code.
Just donated 5. Thanks for your great contribution to b4a.
 

metrick

Active Member
Licensed User
Longtime User
Informatix:
Is there an easy way to move the lvmenu list down 10% or more from the top and still be able press buttons on left-top edge. Currently seem like the left side of the screen is for slidebar touch areas, and any things within the slidebar touch areas is disable for touch event.
 
Last edited:

Informatix

Expert
Licensed User
Longtime User

Could you post a project because I can't see where's the problem ?
 

JTmartins

Active Member
Licensed User
Longtime User
A little help needed

Hello,

I've been playing with this superb class and done a few changes in the layout, but there is one thing I still haven't figured out in the case of the sliding list menu (the one with 3 dots that shows the list view)

But, can we control the dimensions of the system drawable that shows the list ? How ?

I had other questions here, but I managed to solved them, so I Edited the post, and left only this question.

All help will be appreciated.

Many thanks

josé
 
Last edited:

Informatix

Expert
Licensed User
Longtime User

The size of any drawable is defined by the background size. If you set the background of a 50x60 panel with the drawable, the drawable will be sized 50x60.
 
Last edited:

JTmartins

Active Member
Licensed User
Longtime User
Thanks

Newbie here...

But improving everyday thanks to all community.

Thanks

José
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…