Closed fermatijoe closed 7 years ago
Either you use the MaterialDrawer
or the NavigationView
you can't use both
The MaterialDrawer
simplifies most tasks for you. You do not have to define the DrawerLayout
or anything special in the layout
just check out the samples ;)
Hi, thanks for the answer. I don't understand very much of the samples. I have an issue: why is the hambuerger icon gone? And should the drawer be just an empty grey area?
I just used this line: new DrawerBuilder().withActivity(this).build();
@fermatijoe just check out the source code of the sample app. It's very simply java code.
Also read the README.
yes. That's an empty drawer if you do not provide items.
And for the hamburger icon? I am trying now with this version of the code:
new DrawerBuilder() .withActivity(this) .withTranslucentStatusBar(false) .withActionBarDrawerToggle(false) .addDrawerItems( //pass your items here ) .build();
Since my MainActivity xml has appbarlayout and toolbar but I still dont see the icon
I fixed it with getSupportActionBar().setDisplayHomeAsUpEnabled(true);
, you can close this issue, thanks.
I am converting an existing implementation of MaterialDrawer too Kotlin Multi Platform.. When installed, I get the DrawerBuilder import is unresolved. Is MaterialDrawer supported in Kotlin MultiPlatform? Are there any specific examples out there or any known changes to gradle that are needed?
@russelg1 the library is not multiplatform-compatible. As this library depends on the Android View system, which is Android only.
All it's dependencies are not mulitplatform compatible, and there are no plans to make it multiplatform.
Based on the e-mail you also sent it appears to correctly only define this lib for the androidMain
sourceSet.
Also make sure you only use it then from the androidMain
source set in the project. it won't be available for any other target like commonMain, ...
Thanks. Guess I will need to move forward with a Compose alternative
On Mon, Jul 29, 2024, 1:27 AM Mike Penz @.***> wrote:
@russelg1 https://github.com/russelg1 the library is not multiplatform-compatible. As this library depends on the Android View system, which is Android only.
All it's dependencies are not mulitplatform compatible, and there are no plans to make it multiplatform.
— Reply to this email directly, view it on GitHub https://github.com/mikepenz/MaterialDrawer/issues/1855#issuecomment-2255043894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGBGZ5BJQ6W4XQJXLNHWHUTZOXOGPAVCNFSM6AAAAABLS5CYB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGA2DGOBZGQ . You are receiving this because you were mentioned.Message ID: @.***>
Absolutely. If you plan to go multiplatform and want to share UI code, then Compose multiplatform is the way to go. If you want to have platform-specific UI and only share business logic with other platforms you may still use this lib.
The problem appears to be though that (I assume) you were using the DrawerBuilder
in the common sourceSet where it won't work.
Hello, I have created a navigation drawer activity with Android Studio but now I would like to implement MaterialDrawer instead of the existing Drawer because i need drop-down lists. What I'm trying to obtain a is a very stock-like drawer with two main labels and a third one which is an expandable list.
I added the dependency to gradle but I can't manage to replace the old drawer without crashes. Thanks.
My MainActivity.java
`
And activity_main.xml
`