MSMaterialDrawer

thedesolatesoul

Expert
Licensed User
This is a port of library from here: https://github.com/mikepenz/MaterialDrawer
Its an amazing library by Mike Penz and it simplifies most of the Navigation Drawer setup and theming.





Library Setup
1. Copy the MSMaterialDrawer.jar and xml files to your AdditionalLibs folder.
2. This is also dependent on AppCompat v7 Support library, so copy that to AdditionalLibs or use AdditionalJar.
3. Make sure your android.jar in B4A > ConfigurePaths is set to point to android-22 at least.
4. There are 3 resource zip files. Unzip them in your desired area, and use #AdditionalRes to point to them.
5. If you want to use your own theme in styles.xml, you can also point to that with #AdditionalRes.
6. Depending on how you want to use it, (for e.g. with AppCompat Toolbar) you can set #Extends: with extending to ActionbarActivity. You can also specify the theme in the manifest.
7. If you want to use Iconics (Icon fonts), you also need to copy the font files in your files directory in a folder called fonts/ (lowercase).

Library Usage

Creating a simple drawer
Making a simple drawer is amazingly easy. There are two drawer objects:
- MaterialDrawerBuilder: Used to set all the params and build the drawer
- MaterialDrawer: This is the result when you build the drawer from the MaterialDrawerBuilder.

B4X:
Dim MDB As MSMaterialDrawerBuilder
Dim MD As MSMaterialDrawer

MDB.Initialize("MD")
MDB.withAccountHeader(MaterialHeaderResult)
MDB.AddPrimaryDrawerItem  ("Weather"  , p1.Drawable ,Null ,"99+" ,True,1, "Shows the weather")
MDB.AddPrimaryDrawerItem  ("Insanity" , p2.Drawable ,Null ,"2"   ,True,2, "")
MDB.AddPrimaryDrawerItem  ("Awesome"  , p3.Drawable ,Null ,""    ,True,2, "")
MDB.AddSectionDrawerItem  ("Section"  ,True)
MDB.AddSecondaryDrawerItem("Settings" ,s1.Drawable ,Null ,""    ,True ,3)
MDB.AddSecondaryDrawerItem("Help"     ,s2.Drawable ,Null ,""    ,True ,4)
MDB.AddSecondaryDrawerItem("Donate"   ,s3.Drawable ,Null ,""    ,False,5)
MDB.AddSecondaryDrawerItem("Yo"       ,Null        ,Null ,""    ,False,6)

MD = MDB.Build
There are many other options like actionbar/toolbar/statusbar options. Customising the header/footer.
The theming and color can only be changed via styles.xml.

Events
The drawer can raise the following events:
- Closed
- Opened
- ItemClick
- ItemLongClick

In order to know which item was clicked/longclicked you need to assign them an 'identifier' when adding to the drawer, so you can check it later in the click event.

Theming the Drawer
The main way to customize the looks of the drawer is via a theme.
The theme is applied on the activity, and the drawer inherits its properties from that theme.
The library already comes with the following built-in themes that you can set. These built-in themes all depend on the AppCompat library and resources, so make sure you have those linked and copied as well.
  • MaterialDrawerTheme (extends Theme.AppCompat.NoActionBar)
  • MaterialDrawerTheme.TranslucentStatus
  • MaterialDrawerTheme.ActionBar (extends Theme.AppCompat)
  • MaterialDrawerTheme.ActionBar.TranslucentStatus
  • MaterialDrawerTheme.Light (extends Theme.AppCompat.Light.NoActionBar)
  • MaterialDrawerTheme.Light.TranslucentStatus
  • MaterialDrawerTheme.Light.ActionBar (extends Theme.AppCompat.Light)
  • MaterialDrawerTheme.Light.ActionBar.TranslucentStatus
  • MaterialDrawerTheme.Light.DarkToolbar (extends Theme.AppCompat.DarkActionBar) (disabled the ActionBar)
  • MaterialDrawerTheme.Light.DarkToolbar.TranslucentStatus
  • MaterialDrawerTheme.Light.DarkToolbar.ActionBar (extends Theme.AppCompat.DarkActionBar)
  • MaterialDrawerTheme.Light.DarkToolbar.ActionBar.TranslucentStatus

To further theme, you can either inherit from one of these themes and override the colors.
You can also create your own custom style, but be sure to add the style attributes requires by the Material Drawer. An example is available for this.


Using Icon Fonts
The library contains a class called MSIconicDrawable which is a port of this library: https://github.com/mikepenz/Android-Iconics

Basically it allows you to use an Icon Font as a drawable.
What is the advantage of this?
- You cant tint/color the drawable by code which is insanely cool.
- They scale well, and you can set the size according to your needs.
- The ttf files are generally small enough, so you can pack a large number of icons into a manageable file.

Currently there is support for font-awesome and google-material-icons fonts. Others can be added (but missing some features).

How to use:
You must copy the font ttf file in your projects Files/fonts/<fontname>
Here is a link to the fonts used in the project. Download fonts
Then in code:
B4X:
Dim s2 As MSIconicDrawable
s2.Initialize("gmd_help")    'Load a google material design icon
s2.Color = 0xffff4081         'Change the color of icon
Dim s3 As MSIconicDrawable
s3.Initialize("faw_google_wallet") 'Load a font awesome icon
s3.Color = 0xffff4081                 'Change the icon color

'List all icons available in a font
Log(s2.ListDrawables("gmd")) 'List Google material design icons
Log(s2.ListDrawables("faw"))  'List Font awesome icons

'Use the Drawable as
button.Background = s2.Drawable
Demo apk + Source: See here

More information about the icon fonts:
http://fontawesome.io/icons/
http://google.github.io/material-design-icons/
 
Last edited:

thedesolatesoul

Expert
Licensed User
Objects:______________________

Drawer:
  • MSMaterialDrawerBuilder
  • MSMaterialDrawer
MSMaterialDrawerBuilder
Events:

  • Closed
  • ItemClick (Position as Int , Identifier as Int )
  • ItemLongClick (Position as Int , Identifier as Int )
  • Opened
Methods:
  • AddDividerItem As MSMaterialDrawerBuilder
  • AddPrimaryDrawerItem (name As String, icon As Drawable, selectedIcon As Drawable, badge As String, enabled As Boolean, identifier As Int, description As String) As MSMaterialDrawerBuilder
  • AddSecondaryDrawerItem (name As String, icon As Drawable, selectedIcon As Drawable, badge As String, enabled As Boolean, identifier As Int) As MSMaterialDrawerBuilder
  • AddSectionDrawerItem (name As String, divider As Boolean) As MSMaterialDrawerBuilder
  • Build As MSMaterialDrawer
  • Initialize (eventName As String)
  • IsInitialized As Boolean
  • withAccountHeader (accountHeader As Result) As MSMaterialDrawerBuilder
  • withActionbarToggle (toggle As Boolean) As MSMaterialDrawerBuilder
  • withActionbarToggleAnimated (actionBarDrawerToggleAnimated As Boolean) As MSMaterialDrawerBuilder
  • withCloseOnClick (closeOnClick As Boolean) As MSMaterialDrawerBuilder
  • withDrawerGravity (gravity As Int) As MSMaterialDrawerBuilder
  • withDrawerWidthDp (drawerWidthDp As Int) As MSMaterialDrawerBuilder
  • withFooter (footerView As View, width As Int, height As Int) As MSMaterialDrawerBuilder
  • withHeader (headerView As View, width As Int, height As Int) As MSMaterialDrawerBuilder
  • withHeaderClickable (headerClickable As Boolean) As MSMaterialDrawerBuilder
  • withHeaderDivider (enable As Boolean) As MSMaterialDrawerBuilder
  • withSelectedItem (Position As Int) As MSMaterialDrawerBuilder
  • withToolbar (toolbar As Toolbar) As MSMaterialDrawerBuilder
  • withTransluscentStatusbar (translucentStatusBar As Boolean) As MSMaterialDrawerBuilder
MSMaterialDrawer
Methods:

  • CloseDrawer
  • GetFooter As View
  • GetHeader As View
  • IsDrawerOpen As Boolean
  • IsInitialized As Boolean
  • OpenDrawer
  • getPositionFromIdentifier (identifier As Int) As Int
  • updateBadge (position As Int, badge As String)
  • updateIcon (position As Int, icon As Drawable)
  • updateName (position As Int, name As String)
Properties:
  • Selection As Int
  • SelectionByIdentifier As Int [write only]

Profiles:
  • MSAccountHeaderBuilder
  • MSProfile
MSAccountHeaderBuilder
Events:

  • ProfileChanged (Profile as MSProfile As )
  • ProfileClicked (Profile as MSProfile As )
Methods:
  • Initialize (eventName As String)
  • IsInitialized As Boolean
  • addProfiles (profiles() As IProfile) As MSAccountHeaderBuilder
  • build As Result
  • withAccountHeader (accountHeader As View) As MSAccountHeaderBuilder
  • withAlternativeProfileHeaderSwitching (alternativeProfileHeaderSwitching As Boolean) As MSAccountHeaderBuilder
  • withCompactStyle (compactStyle As Boolean) As MSAccountHeaderBuilder
  • withDrawer (drawer As Result) As MSAccountHeaderBuilder
  • withHeaderBackground (headerBackground As Drawable) As MSAccountHeaderBuilder
  • withHeaderBackgroundScaleType (headerBackgroundScaleType As ScaleType) As MSAccountHeaderBuilder
  • withHeightDp (heightDp As Int) As MSAccountHeaderBuilder
  • withOnAccountHeaderListener (onAccountHeaderListener As OnAccountHeaderListener) As MSAccountHeaderBuilder
  • withOnAccountHeaderSelectionViewClickListener (onAccountHeaderSelectionViewClickListener As OnAccountHeaderSelectionViewClickListener) As MSAccountHeaderBuilder
  • withProfile (profile As IProfile) As MSAccountHeaderBuilder
  • withProfileImagesClickable (profileImagesClickable As Boolean) As MSAccountHeaderBuilder
  • withProfileImagesVisible (profileImagesVisible As Boolean) As MSAccountHeaderBuilder
  • withProfiles (profiles As ArrayList) As MSAccountHeaderBuilder
  • withSelectionFirstLine (selectionFirstLine As String) As MSAccountHeaderBuilder
  • withSelectionFistLineShown (selectionFirstLineShown As Boolean) As MSAccountHeaderBuilder
  • withSelectionListEnabled (selectionListEnabled As Boolean) As MSAccountHeaderBuilder
  • withSelectionListEnabledForSingleProfile (selectionListEnabledForSingleProfile As Boolean) As MSAccountHeaderBuilder
  • withSelectionSecondLine (selectionSecondLine As String) As MSAccountHeaderBuilder
  • withSelectionSecondLineShown (selectionSecondLineShown As Boolean) As MSAccountHeaderBuilder
  • withTextColor (textColor As Int) As MSAccountHeaderBuilder
  • withThreeSmallProfileImages (threeSmallProfileImages As Boolean) As MSAccountHeaderBuilder
  • withTranslucentStatusBar (translucentStatusBar As Boolean) As MSAccountHeaderBuilder
MSProfile
Methods:

  • isSelectable As Boolean
  • setSelectable (selectable As Boolean) As MSProfile
  • withEmail (email As String) As MSProfile
  • withIcon (icon As Drawable) As MSProfile
  • withIdentifier (identifier As Int) As MSProfile
  • withName (name As String) As MSProfile
  • withSelectable (selectable As Boolean) As MSProfile

Properties:
  • Email As String
  • Icon As Drawable
  • IconUri As Uri [read only]
  • Identifier As Int
  • Name As String
DrawerItems:
  • MSPrimaryDrawerItem
  • MSSecondaryDrawerItem
  • MSSectionedDrawerItem
  • MSDividerDrawerItem
MSPrimaryDrawerItem
Methods:

  • Initialize
  • IsInitialized As Boolean
  • isEnabled As Boolean
Properties:
  • Badge As String
  • Description As String
  • Enabled As Boolean [write only]
  • Icon As Drawable
  • Identifier As Int
  • Name As String
  • Tag As Object
  • Type As String [read only]
MSSecondaryDrawerItem
Methods:

  • Initialize
  • IsInitialized As Boolean
  • isEnabled As Boolean
Properties:
  • Badge As String
  • Enabled As Boolean [write only]
  • Icon As Drawable
  • Identifier As Int
  • Name As String
  • Tag As Object
  • Type As String [read only]

IconFonts:
  • MSIconicDrawable
MSIconicDrawable
Methods:

  • Initialize (icon As String) As Drawable
  • ListDrawables (typeface As String) As List
  • actionBarSize
  • paddingDp (iconPadding As Int)
  • sizeDp (size As Int)
Properties:
  • Alpha As Int
  • BackgroundColor As Int [write only]
  • Color As Int [write only]
  • Drawable As Drawable [read only]
 
Last edited:

thedesolatesoul

Expert
Licensed User
Frequently Asked Questions_________________

Q1. Where can when can I download this library?
A1. See Post 4.
Q2. Can you add toggle/switch buttons in the drawer?
A2. Yes, this is not implemented. Convince me to do it with some incentive.
Q3. The github source has a lot more features, has been updated, when will you update the library?
A3. I wont update it unless there is a good reason to.
Q4. Can I have the source?
A4. Send me a PM and I will need to link you to the GitLab Repo.

Q5. I see errors like this:
B4X:
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:8: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
A5. Make sure in B4A > Configure paths > android.jar is pointing towards the android-22 or later jar.
Make sure you have the appcompat support libraries referenced (by copying to AdditionalLibs or by using AdditionalJar). (from: C:\android-sdk\extras\android\support\v7\appcompat\libs)

Q6. I initialized the MSIconicDrawable, but I dont see any drawable or icons when i run the app?
A6. Make sure you actually copied and added the font files in the Files directory of the project. These must be under Files/fonts/ directory with the fonts being in lowecase.

List of Files, Examples and Demos
Demos and Examples:
Main demo
Theming
Using with AppCompat/Toolbar
Custom Header

Files:
MSMaterialDrawer/AdditionalResources/appcompat.zip
MSMaterialDrawer/AdditionalResources/md-app.zip
MSMaterialDrawer/AdditionalResources/md-lib.zip
MSMaterialDrawer/B4A Samples/AppCompatDrawer
MSMaterialDrawer/B4A Samples/MSMaterialDrawerSample.zip
MSMaterialDrawer/Demo/AppCompatDrawer.apk
MSMaterialDrawer/Demo/MSMaterialDrawer.apk
MSMaterialDrawer/Demo/MSMaterialDrawerCustom.apk
MSMaterialDrawer/Library/MSMaterialDrawer.zip

Demo thread: http://www.b4x.com/android/forum/threads/msmaterialdrawer-build-navigation-drawers-fast.52972/
 
Last edited:

thedesolatesoul

Expert
Licensed User
Current Status
Current Version:
0.93
What is not implemented:
  • Having toggles and switches in the drawer
  • Using MSPrimaryDrawerItem, MSSecondaryDrawerItem (they exist as objects but the builder does not yet accept them as arguments) mainly due to duplication and inheritance

Changelog:
0.93:
Added _Slide event.
Added withDisplayUnderToolbar method.
Updated to the latest Repo code.

Known Bugs:
None, although im shaky on the header click and AccountBuilder

Download and licence
Before you download make sure you read every single line in the above posts!
You should not re-distribute any of these files unless compiled to apk.
The files are too big for the forum so need to be downloaded off a link.
Download here Donate here
 
Last edited:

AndOrNot

Well-Known Member
Licensed User
My application start so:
B4X:
#Region  Project Attributes
    #ApplicationLabel: App
    #VersionCode: 1
    #VersionName: 1beta
    
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
   
    #AdditionalJar: android-support-v7-appcompat
    #AdditionalRes: C:\Users\Giuseppe\Desktop\Extra\app\res
    #AdditionalRes: C:\Users\Giuseppe\Desktop\Extra\appcompat\res
    #AdditionalRes: C:\Users\Giuseppe\Desktop\Extra\lib\res
   
    #IncludeTitle: True
    #FullScreen: True
#End Region
I got this error
B4X:
B4A version 4.30
Parsing code.                           0.00
Compiling code.                         0.05
Compiling layouts code.                 0.00
Generating R file.                      Error
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:8: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:6: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:7: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v19\styles.xml:5: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:13: error: Error: No resource found that matches the given name: attr 'android:statusBarColor'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:12: error: Error: No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:14: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v19\styles.xml:8: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:24: error: Error: No resource found that matches the given name: attr 'android:statusBarColor'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:23: error: Error: No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:25: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:34: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:32: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:33: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v19\styles.xml:14: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:39: error: Error: No resource found that matches the given name: attr 'android:statusBarColor'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:38: error: Error: No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:40: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v19\styles.xml:17: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:50: error: Error: No resource found that matches the given name: attr 'android:statusBarColor'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:49: error: Error: No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:51: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:60: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:58: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:59: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v19\styles.xml:23: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:65: error: Error: No resource found that matches the given name: attr 'android:statusBarColor'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:64: error: Error: No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:66: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v19\styles.xml:26: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:76: error: Error: No resource found that matches the given name: attr 'android:statusBarColor'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:75: error: Error: No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.
C:\Users\Giuseppe\Desktop\Extra\lib\res\values-v21\styles.xml:77: error: Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:84: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:49: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:195: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:199: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:114: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:116: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:118: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:111: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:124: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:108: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:129: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:141: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:146: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:132: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:135: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:149: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:153: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:157: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:161: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:167: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:171: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:175: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:94: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:98: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:102: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:189: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.CheckBox'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:191: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.RadioButton'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:62: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:177: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:179: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:181: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Small'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:183: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:185: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless.Colored'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:203: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.TextView.SpinnerItem'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:205: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.TextView.SpinnerItem'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base.xml:187: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ButtonBar'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:30: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:38: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:40: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:42: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:60: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:46: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:48: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:50: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:52: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:54: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:56: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\styles_base_text.xml:58: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:20: error: Error: No resource found that matches the given name: attr 'android:layout_marginStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:25: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:24: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:29: error: Error: No resource found that matches the given name: attr 'android:layout_alignParentEnd'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:33: error: Error: No resource found that matches the given name: attr 'android:layout_alignParentStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:37: error: Error: No resource found that matches the given name: attr 'android:layout_toStartOf'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:42: error: Error: No resource found that matches the given name: attr 'android:layout_toEndOf'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:41: error: Error: No resource found that matches the given name: attr 'android:layout_toStartOf'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:47: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:52: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:51: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:56: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:60: error: Error: No resource found that matches the given name: attr 'android:layout_marginStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:64: error: Error: No resource found that matches the given name: attr 'android:layout_alignParentStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:65: error: Error: No resource found that matches the given name: attr 'android:textAlignment'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v17\styles_rtl.xml:69: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:158: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:162: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:160: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:161: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:159: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:156: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:157: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:169: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:173: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:171: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:172: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:170: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:167: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:168: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:87: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:91: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:89: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:90: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:88: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:85: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:86: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:136: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:140: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:139: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:144: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
C:\Users\Giuseppe\Desktop\Extra\appcompat\res\values-v21\themes_base.xml:148: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
Can you help me? I miss something?
 

DonManfred

Expert
Licensed User
#AdditionalRes: C:\Users\Giuseppe\Desktop\Extra\appcompat\res
change it to
B4X:
#AdditionalRes: C:\Users\Giuseppe\Desktop\Extra\appcompat\res, android.support.v7.appcompat
like described in the AppCompat tutorials.

And maybe you are missing this line?
B4X:
#AdditionalRes: E:\Android\android-sdk\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
 

thedesolatesoul

Expert
Licensed User
My application start so:
I got this error

Can you help me? I miss something?
Please see Q5 of the Frequently asked questions. (updated)

Hi.Thank you DonMantred this library can be best library in material scope.
I get error when execute your example
What's problem?

sample 1



sample 2
Please post logs as text (in code/spoiler tags) so I can copy/paste into google.
I've seen this before, i cant remember how i fixed it. It is not an issue with the sample or code.
 

AndOrNot

Well-Known Member
Licensed User
I've got the same problem @thedesolatesoul, there is a report:
B4X:
LogCat connected to: B4A-Bridge: WIKO RAINBOW
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (service1) Create **
** Service (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:it.mazinthebox.naf15
** Activity (main) Create, isFirst = true **
(Main, 24) FullScreen or IncludeTitle properties in layout file do not match the activity attributes settings. (warning #1004)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (actlight) Create, isFirst = true **
android.view.InflateException: Binary XML file line #12: Error inflating class com.mikepenz.materialdrawer.view.ScrimInsetsFrameLayout
    at android.view.LayoutInflater.createView(LayoutInflater.java:620)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    at com.mikepenz.materialdrawer.Drawer.withDrawerLayout(Drawer.java:246)
    at com.mikepenz.materialdrawer.Drawer.build(Drawer.java:965)
    at com.maximussoft.msmaterialdrawer.MSMaterialDrawerBuilder.Build(MSMaterialDrawerBuilder.java:112)
    at it.mazinthebox.naf15.actlight._activity_create(actlight.java:514)
    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 it.mazinthebox.naf15.actlight.afterFirstLayout(actlight.java:100)
    at it.mazinthebox.naf15.actlight.access$100(actlight.java:17)
    at it.mazinthebox.naf15.actlight$WaitForLayout.run(actlight.java:78)
    at android.os.Handler.handleCallback(Handler.java:808)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5292)
    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:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.constructNative(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at android.view.LayoutInflater.createView(LayoutInflater.java:594)
    ... 23 more
Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x5/d=0x1 a=1}
    at android.content.res.Resources.loadDrawable(Resources.java:2124)
    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
    at com.mikepenz.materialdrawer.view.ScrimInsetsFrameLayout.init(ScrimInsetsFrameLayout.java:66)
    at com.mikepenz.materialdrawer.view.ScrimInsetsFrameLayout.<init>(ScrimInsetsFrameLayout.java:52)
    ... 26 more
 

thedesolatesoul

Expert
Licensed User
I've got the same problem @thedesolatesoul, there is a report:
Thank you, your bug report helped me. I have uploaded a fix to the same link, please try it again.
I had a hardcoded resource value in the R.java, which is why it always worked for me and not for others.
 

omidaghakhani1368

Well-Known Member
Licensed User
Please see Q5 of the Frequently asked questions. (updated)


Please post logs as text (in code/spoiler tags) so I can copy/paste into google.
I've seen this before, i cant remember how i fixed it. It is not an issue with the sample or code.
Sorry
 

Peter Simpson

Expert
Licensed User
This is great stuff @thedesolatesoul, well one is :).
I got MSMaterialDrawer working 1st time out with no issues whatsoever, what a great drawer. But app AppCompatToolbar1, well that was another matter completely. Anyway I've deleted AppCompatToolbar1 now as I just could not get it to run. The most annoying things was there was no error log messages, the app just starts and crashes straight away with only this in the log screen.
B4X:
Installing file.
PackageAdded: package:de.amberhome.appcompat.toolbarexample1
I tried in both Debug modes and I'm using android-22\android.jar. MSMaterialDrawer is truly awesome though, I'm definitely going to use it, cheers...
 
Last edited:

wes58

Active Member
Licensed User
This is great stuff @thedesolatesoul, well one is :).
I got MSMaterialDrawer working 1st time out with no issues whatsoever, what a great drawer. But app AppCompatToolbar1, well that was another matter completely. Anyway I've deleted AppCompatToolbar1 now as I just could not get it to run. The most annoying things was there was no error log messages, the app just starts and crashes straight away with only this in the log screen.
B4X:
Installing file.
PackageAdded: package:de.amberhome.appcompat.toolbarexample1
I tried in both Debug modes and I'm using android-22\android.jar. MSMaterialDrawer is truly awesome though, I'm definitely going to use it, cheers...
If it crashes you have to check themes.xml file in project resource/values/ folder and change it as shown below. After that it should be working fine.
B4X:
change line:
        <item name="android:windowNoTitle">true</item>
 to:
        <item name="windowNoTitle">true</item>
 

bluedude

Well-Known Member
Licensed User
Awesome. However, I think I found a problem in combination with the appcompat toolbar.

I get this error when combining both:

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.

Any suggestions?
 
Top