MSMaterialDrawer

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.
 

Fusseldieb

Active Member
Licensed User
Longtime User
does somebody knows how to change the activity toggle (animated Burguer arrow) color ?
 

aaronk

Well-Known Member
Licensed User
Longtime User
What does the down arrow in the header do, as shown in the screenshot? Can you make it popup a menu when you tap on it ?
Also, how would you remove it if you don't want to use it ?


upload_2015-5-30_17-29-45.png


Another thing I want to know, is there a way to make it so that when you tap on a item in the list to then display a sub menu under it when the user taps on a item ?
 

thedesolatesoul

Expert
Licensed User
Longtime User
What does the down arrow in the header do, as shown in the screenshot? Can you make it popup a menu when you tap on it ?
Also, how would you remove it if you don't want to use it ?


View attachment 34363

Another thing I want to know, is there a way to make it so that when you tap on a item in the list to then display a sub menu under it when the user taps on a item ?
I'm guessing you didnt try any of the samples or demos?
That is an account selection header. You dont need the header at all, just dont add it to your drawer.
You cannot make that particular one a popup menu, it displays a list of accounts to select from.

You can include a custom header, and add a popup menu with it. Should be very easy.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Another thing I want to know, is there a way to make it so that when you tap on a item in the list to then display a sub menu under it when the user taps on a item ?
If you mean like an expandable listview/menu, then no. I'm not aware how to do that with this library.
 

jotaele

Member
Licensed User
Longtime User
Is there any way to change the font size of the elements of the Primary Menu?

The font in my phone is too small.

Thanks
 

thedesolatesoul

Expert
Licensed User
Longtime User
Is there any way to change the font size of the elements of the Primary Menu?

The font in my phone is too small.

Thanks
Yes. Where you extracted the md-lib.zip go into values/dimens.xml

Change this value to what you want:
B4X:
<dimen name="material_drawer_item_primary_text">14sp</dimen>

This is probably following the material design guidelines so i dont really recommend going about changing things.
 

MarcoRome

Expert
Licensed User
Longtime User
Hi All i have this error:

B4X:
B4A version 4.30
Parsing code.                           0.02
Compiling code.                         0.09
   
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.                 0.00
Generating R file.                      Error
C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res\values\attrs.xml:28: error: Attribute "title" has already been defined
C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res\values\attrs.xml:29: error: Attribute "height" has already been defined
C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res\values\attrs.xml:31: error: Attribute "isLightTheme" has already been defined
C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res\values\attrs.xml:43: error: Attribute "windowActionBar" has already been defined
C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res\values\attrs.xml:51: error: Attribute "windowActionBarOverlay" has already been defined
C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res\values\attrs.xml:55: error: Attribute "windowActionModeOverlay" has already been defined
....

in my code i have this:

B4X:
#Region  Project Attributes
    #ApplicationLabel: AppCompatDrawer
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

'Theme Resources
#AdditionalRes: ..\resource
'AppCompat Resources
'#AdditionalRes: H:\WinLibraries\Downloads\AppCompat_v1_10\b4a_appcompat, de.amberhome.objects.appcompat
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res, de.amberhome.objects.appcompat

'#AdditionalRes: C:\Android\adt-bundle-windows-x86_64\sdk\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat

'MaterialDrawer Resources
'#AdditionalRes: H:\MyProjects\Github_masters\MaterialDrawer-master\MaterialDrawer-master\library\src\main\res
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-lib\res

'#AdditionalRes: H:\MyProjects\Github_masters\MaterialDrawer-master\MaterialDrawer-master\app\src\main\res
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-app\res

'Activity Type
#Extends: android.support.v7.app.ActionBarActivity


#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

upload_2015-6-2_12-15-23.png


Any idea ??
Thank you
Marco
 

thedesolatesoul

Expert
Licensed User
Longtime User
The appcompat resources are the same, no need to define them twice.
I only included them for convenience.

oops wait, looks like one is pointing to corwins AppCompat Wrapper resources

what is here:
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res, de.amberhome.objects.appcompat
Try removing that line.
 

MarcoRome

Expert
Licensed User
Longtime User
The appcompat resources are the same, no need to define them twice.
I only included them for convenience.

oops wait, looks like one is pointing to corwins AppCompat Wrapper resources

what is here:
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res, de.amberhome.objects.appcompat
Try removing that line.

Thank you Thedesolatesoul
i modified this line:

B4X:
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res, de.amberhome.objects.appcompat

in this line:

B4X:
#AdditionalRes: C:\AnywhereSoftware\Basic4android\b4a_appcompat, de.amberhome.objects.appcompat

in this folder i have b4a_appcompat

Now i have this error:

B4X:
..\resource\values\themes.xml:7: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.

In B4A > Configure paths > android.jar is pointing towards the android-22 or later jar.

upload_2015-6-2_12-54-25.png


and i add the appcompat support libraries (by copying to AdditionalLibs or by using AdditionalJar). (from: C:\android-sdk\extras\android\support\v7\appcompat\libs)

upload_2015-6-2_12-56-12.png
 

MarcoRome

Expert
Licensed User
Longtime User
Also i have remove this line:

B4X:
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\AppCompat\res, de.amberhome.objects.appcompat

i have some error:

B4X:
B4A version 4.30
Parsing code.                           0.02
Compiling code.                         0.08
   
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.                 0.02
Generating R file.                      Error
..\resource\values\themes.xml:7: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.

:confused:
 

thedesolatesoul

Expert
Licensed User
Longtime User
Can you try to compile with these lines:
B4X:
'Theme Resources
#AdditionalRes: ..\resource
'AppCompat Resources
#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'MaterialDrawer Resources
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-lib\res
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-app\res
 

MarcoRome

Expert
Licensed User
Longtime User
Can you try to compile with these lines:
B4X:
'Theme Resources
#AdditionalRes: ..\resource
'AppCompat Resources
#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'MaterialDrawer Resources
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-lib\res
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-app\res


i try but dont change error:

B4X:
'Theme Resources
'#AdditionalRes: ..\resource
''AppCompat Resources
''#AdditionalRes: H:\WinLibraries\Downloads\AppCompat_v1_10\b4a_appcompat, de.amberhome.objects.appcompat
''#AdditionalRes: C:\AnywhereSoftware\Basic4android\b4a_appcompat, de.amberhome.objects.appcompat
'
''#AdditionalRes: C:\Android\adt-bundle-windows-x86_64\sdk\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'                       
'
''MaterialDrawer Resources
''#AdditionalRes: H:\MyProjects\Github_masters\MaterialDrawer-master\MaterialDrawer-master\library\src\main\res
'#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-lib\res
'
''#AdditionalRes: H:\MyProjects\Github_masters\MaterialDrawer-master\MaterialDrawer-master\app\src\main\res
'#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-app\res

'Theme Resources
#AdditionalRes: ..\resource
'AppCompat Resources
#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'MaterialDrawer Resources
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-lib\res
#AdditionalRes: C:\AnywhereSoftware\Basic4android\msmaterialdrawneresource\md-app\res

'Activity Type
'#Extends: android.support.v7.app.ActionBarActivity

upload_2015-6-2_14-1-0.png
 

Attachments

  • upload_2015-6-2_14-0-0.png
    upload_2015-6-2_14-0-0.png
    153.5 KB · Views: 138

thedesolatesoul

Expert
Licensed User
Longtime User
Ok,
goto C:\Android\extras\android\support\v7\appcompat\res\values\attrs.xml
and see if you can find the following line:
B4X:
<!-- Flag indicating whether there should be no title on this window. -->
        <attr name="windowNoTitle" format="boolean" />
if its not there your res files are not up to date with android-22 platform, and your support library is also likely out of date.
 

MarcoRome

Expert
Licensed User
Longtime User
Ok,
goto C:\Android\extras\android\support\v7\appcompat\res\values\attrs.xml
and see if you can find the following line:
B4X:
<!-- Flag indicating whether there should be no title on this window. -->
        <attr name="windowNoTitle" format="boolean" />
if its not there your res files are not up to date with android-22 platform, and your support library is also likely out of date.

This line exist. Anyway i update SDK 22.0.1 and now compile


upload_2015-6-2_16-3-33.png


but when start i have this message :

upload_2015-6-2_16-5-1.png



This is log :

B4X:
Installing file.
PackageAdded: package:com.maximussoft.appcompatdrawer
** Activity (main) Create, isFirst = true **
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
    at com.maximussoft.appcompatdrawer.main._activity_create(main.java:348)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
    at com.maximussoft.appcompatdrawer.main.afterFirstLayout(main.java:100)
    at com.maximussoft.appcompatdrawer.main.access$100(main.java:17)
    at com.maximussoft.appcompatdrawer.main$WaitForLayout.run(main.java:78)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5692)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:54)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
    ... 17 more
Caused by: java.lang.NoClassDefFoundError: de.amberhome.objects.appcompat.R$style
    at de.amberhome.objects.appcompat.ACToolbarLightWrapper.innerInitialize(ACToolbarLightWrapper.java:26)
    at anywheresoftware.b4a.objects.ViewWrapper.Initialize(ViewWrapper.java:64)
    at de.amberhome.objects.appcompat.ACToolBarWrapper.Initialize(ACToolBarWrapper.java:45)
    at de.amberhome.objects.appcompat.ACToolBarWrapper._initialize(ACToolBarWrapper.java:77)
    ... 21 more

upload_2015-6-2_16-8-18.png
 

MarcoRome

Expert
Licensed User
Longtime User
Resolved also if you have sdk 22 but no 22.0.1 you have this error ( for me is so ).
After that you update and copy "new" file:

android-support-v4.jar
android-support-v7-appcompat.jar
android-support-v7-mediarouter.jar

in your library work without problem

Thank you very much thedesolatesoul for your support
 
Top