B4A Library [Class] SlidingSidebar

Informatix

Expert
Licensed User
Longtime User
When you get time, please go through Google's new guidelines for sliding sidebars and kindly update it based on their recommendations (like dimming the main content panel when the sidebar is open, etc..).

Navigation Drawer | Android Developers

For now, I have no real intent to do so because:
1) I never created this class to be a replacement for a navigation drawer (this class doesn't even exist when I created mine);
2) I currently have no time for this;
3) If you need to dim the sidebar while opening/closing, it's so easy to do (and one of my examples does it) that you don't really need me to add this.

BUT I have nothing against the idea. Just tell me precisely what features are missing and highly expected.
 

CidTek

Active Member
Licensed User
Longtime User
For now, I have no real intent to do so because:
3) If you need to dim the sidebar while opening/closing, it's so easy to do (and one of my examples does it) that you don't really need me to add this.

I tried to find some info on how to dim a panel but searching the forums returns every article that contains a "dim" source code statement.

BTW, its not the sidebar that needs to be in a dim state but rather the panel it is partially covering.

Do you know of any posts that address this?
 

RiverRaid

Active Member
Licensed User
Longtime User
Hi..

I tried to increase the size of the GesturePanel to 100%x, to catch the gesture on the whole screen...

But now, of course, the Buttons on the Activity can not be clicked any more. Is there a way to cast the clicks to the buttons?

Thanks!
 

Informatix

Expert
Licensed User
Longtime User
I tried to increase the size of the GesturePanel to 100%x, to catch the gesture on the whole screen...

But now, of course, the Buttons on the Activity can not be clicked any more. Is there a way to cast the clicks to the buttons?

Thanks!

Yes, you can. In the Gesture_onTouch handler, check if the buttons are concerned by the click, then return False to delegate the event to the underlying button.
 

mcmanu

Active Member
Licensed User
Longtime User
Very nice but is it possible to make the panel hight not so high than the activity?
Because i can not click any button on my Activity when i use this sliding sidebar
Because the hole panel is over the activity and my views
 

mcmanu

Active Member
Licensed User
Longtime User
I have an Application with about 100 views on it. When i use the sidebar i can not click any button. When the sidebar is closed i can not click any button on my activity as well. Hope you know what i mean

What can i do to use my views, when the sidebar is closed? (sample with the handle)
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Oh I see your mistake now! SlidingSidebar is not just a sliding menu on a side, it replaces the whole screen. It is made of two panels: the slidebar panel and the content panel. The content panel is meant to hold all the views displayed when the sidebar is closed. Thus, to adapt your application, you have to replace all Activity.AddView by MySlidingSidebar.ContentPanel.AddView.
If you want to limit the SlidingSidebar to a region of your activity, create a panel bounding this region and pass the panel as the first parameter of the Initialize function of the class.
 

mcmanu

Active Member
Licensed User
Longtime User
Oh right, i missunderstood the behavior, thank you very much
Okay, then i will give it a try
 

IDDGroup

Member
Licensed User
Longtime User
Trying to just run the sample programs. using a nexus 5 (kitkat) and B4a 3.

on the SlidingDrawer, and SlidingSidebar examples, i am getting:

java.lang NoSuchFieldException: left_Shadow

on line 82

ID_Drawable = r.GetStaticField(package & ".R$drawable", ImageName)

is there some change that is causing it not to work?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…