MSMaterialDrawer

MarcoRome

Expert
Licensed User
Longtime User

Which error do you have ?
 
D

Deleted member 30048

Guest
Well , I solved the issue using android support r22 and remove the line " <item name =" windowNoTitle "> true < / item> " of themes.xml .
 

thedesolatesoul

Expert
Licensed User
Longtime User
Overall there is some complex setup invovled. Re-read the docs until you get it right:
1. The SDK jar that B4A points to
2. The support-v7 jars that are either in your additionalibs or additionaljar.
3. The res files from the support libs
4. The res files from this libs (in my link)

I dont have time to fix everyones issues on this, if you cant get it right just keep reading the docs again and again.
 
D

Deleted member 30048

Guest

Ok, I upgraded B4A to version 5.0, tried again and now it works. Maybe the problem was that I was using a beta version.
 

migrec

Member
Licensed User
Longtime User
Can't get it working with the appcompat toolbar, I tried all of you themes and it only crashes at startup, any ideas?
I am trying to set a dark theme for the material drawer btw.
 

thedesolatesoul

Expert
Licensed User
Longtime User
There are too many dependencies and reasons for crash for me to be able to tell you what is wrong.
I am just going to say you have to make sure all the versions are concurrently at the same level, the best way is to update everything.
If you can get the crash log, that will be helpful.
Otherwise, one of these 4 things is wrong:
1. The SDK jar that B4A points to
2. The support-v7 jars that are either in your additionalibs or additionaljar.
3. The res files from the support libs
4. The res files from this libs (in my link)
 

migrec

Member
Licensed User
Longtime User
Oh sorry,
1. It points to 22
2. the latest ones are in my addiotionalibs folder
3. paths are correct
screenshot over appcompat/material drawer/toolbar:

Crash log:
B4X:
** Activity (main) Create, isFirst = true **


** Activity (main) Resume **


** Activity (main) Pause, UserClosed = false **


java.lang.RuntimeException: Unable to start activity ComponentInfo{b4a.example/b4a.example.home}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
    at android.app.ActivityThread.access$600(ActivityThread.java:127)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4441)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)


Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features
    at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:363)
    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:237)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:111)
    at b4a.example.home.onCreate(home.java:59)
    at android.app.Activity.performCreate(Activity.java:4465)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
    ... 11 more
It occurs when I set (for example) this theme: SetApplicationAttribute(android:theme, "@style/MaterialDrawerTheme.Light.DarkToolbar")
though it runs with SetApplicationAttribute(android:theme, "@style/MyAppTheme")
 

migrec

Member
Licensed User
Longtime User
nope sorry
B4X:
B4A version 4.30
Parsing code.                           0.02
Compiling code.                         0.03
Compiling layouts code.                 0.01
Generating R file.                      Error
C:\Users\Can\Desktop\AdditionalRes\MDLIBRES\values\styles.xml:115: error: Error parsing XML: not well-formed (invalid token)
won't even compile now...
 

koaunglay

Member
Licensed User
Longtime User
Very beautiful design! I like your design and tutorial. But I can't find your msmaterialdrawer.jar and .xml. Where can I download it. Thanks Thedesolatesoul!
 

thedesolatesoul

Expert
Licensed User
Longtime User
Sorry my home PC has been off for a while now, let me try to get you an xml, can you try with the one attached?
You have to put it in the same place.
 

Attachments

  • styles.xml
    8 KB · Views: 273

migrec

Member
Licensed User
Longtime User
Sorry my home PC has been off for a while now, let me try to get you an xml, can you try with the one attached?
You have to put it in the same place.
It does compile now! though the drawer is still light... I am starting to think that it might be an error in my code...
 

migrec

Member
Licensed User
Longtime User
Yeah so with the new styles.xml you gave me and this theme:
B4X:
SetApplicationAttribute(android:theme, "@style/MaterialDrawerTheme")
it's now all working and looking awesome. I'm truly sorry for wasting your time but my stupidity is really time-consuming
However, thanks a bunch once again tds...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…