MSMaterialDrawer

bluedude

Well-Known Member
Licensed User
Longtime User
I got it working for an hour without this warning:

java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

But now I changed a few theme colors and it stops working with the Material appcompat toolbar. I have added

<item name="android:windowActionBar">false</item>

to my theme file but no luck anymore. Suggestions?
 

thedesolatesoul

Expert
Licensed User
Longtime User
I got it working for an hour without this warning:

java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

But now I changed a few theme colors and it stops working with the Material appcompat toolbar. I have added

<item name="android:windowActionBar">false</item>

to my theme file but no luck anymore. Suggestions?
It should be:
B4X:
<item name="windowActionBar">false</item>
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi @thedesolatesoul,

I thought its through donation but you have given it for free. I will give my first earnings from my app to you. Thank you for your amazing work. Thank you for being awesome :)

Regards,
SK
 

shashkiranr

Active Member
Licensed User
Longtime User
Its for the effort to wrap the library to b4a. I have tried to wrap many libs but i failed all the time... so i know the effort needed to wrap such a big library :)
 

shashkiranr

Active Member
Licensed User
Longtime User
HI All,

1. Is there an option to add the navigation drawer to open only under the actionbar. currently it opens using full screen.

2. I tried to add the MSIconicDrawable to the appcompact but it is not visible. I used the below code.
B4X:
ActionBar.Menu.Add2(1,1,"Save",IconicDrawable.Drawable)
So is it possible to add the iconic drawable?

Edit : The icon is added but somehow it is not visible :confused:

Regards,
SK
 
Last edited:

thedesolatesoul

Expert
Licensed User
Longtime User
HI All,
1. Is there an option to add the navigation drawer to open only under the actionbar. currently it opens using full screen.
I'm assuming you are testing on lollipop otherwise it should display on top of the actionbar?
This is actually the default by google's standards.
Can you try with:
B4X:
MDB.withTranslucentStatusBar(false)
I have also checked there is a new method in the source library to withDisplayBelowToolbar. This would require a full update.

2. I tried to add the MSIconicDrawable to the appcompact but it is not visible. I used the below code.
B4X:
ActionBar.Menu.Add2(1,1,"Save",IconicDrawable.Drawable)
So is it possible to add the iconic drawable?

Edit : The icon is added but somehow it is not visible :confused:
Are you setting the color of the drawable? I think its black by default. I havent actually tried it with an actionbar. If you have a sample project I could try it.

@thedesolatesoul and other B4A developers work really hard on wrapping libraries. If there's a donate button then if one can afford to donate, I think one should donate. The amount of development time libraries save us is just incredible, so I for one donate.
You are just too kind :)
 

thedesolatesoul

Expert
Licensed User
Longtime User
Hi @thedesolatesoul,

I have attached the example app compact project. The iconiDrawable is not visible.

Regards
SK
You are right, it only works on Lollipop and that too when the icon size is set.
I'll need to figure out why it isnt working on <API21.
Thanks for reporting this.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Hi @thedesolatesoul,

I have attached the example app compact project. The iconiDrawable is not visible.

Regards
SK
Dude, after 2 hours of debug I realized that you didnt even include the fonts in the project!
It worked on lollipop as it just displays a symbol for drawable_not_found for some reason.
I'm going to upload the fonts shortly but you can get them in this demo here: https://www.b4x.com/android/forum/threads/demo-sauce-msiconicdrawable-cardview-dynamicgrid.53983/

Documented here:
See post1, Library Setup, point 7.
Then in the same post, see Using Icon Fonts > How to use
I'm going to add this to the FAQ and put more emphasis in the post.

You would think that technically it would throw an exception or log an error (from the source library).
I did check IconicsDrawable.ListDrawables.IndexOf("gmd_save") which came out to be 281 so i thought it must be there.

I'll do some more checks to make it more robust.
Thanks for your patience.
 

thedesolatesoul

Expert
Licensed User
Longtime User
1. Is there an option to add the navigation drawer to open only under the actionbar. currently it opens using full screen.
Updated to use withDisplayBelowToolbar method, so it only shows under the actionbar.

I have updated the library to version 0.93. Now it depends on AppCompat support library v22. It will not work with v21. (Say thanks to google).
If you use version v21 you will see errors regarding attr not found.
 

qsrtech

Active Member
Licensed User
Longtime User
Is there anyway to use the drawer with multiple activities?
 

qsrtech

Active Member
Licensed User
Longtime User
Hmmmm. off the too off my head maybe there is a way to create a class and wrap/control one "global" drawer...
 

thedesolatesoul

Expert
Licensed User
Longtime User
Hmmmm. off the too off my head maybe there is a way to create a class and wrap/control one "global" drawer...
I wouldnt do that. That would leak an activity context. The only way this would work if the view and the drawer structure are decoupled and the structure is a process global element.
 
Top