Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mini drawer -> Persistent Drawer #713

Closed
timrae opened this issue Oct 2, 2015 · 6 comments
Closed

Mini drawer -> Persistent Drawer #713

timrae opened this issue Oct 2, 2015 · 6 comments
Assignees
Labels

Comments

@timrae
Copy link

timrae commented Oct 2, 2015

It could be really cool if we could do the persistent drawer in the material design spec. I tried using .withDrawerLayout() with a permanent DrawerLayout inside a LinearLayout in my XML, but that didn't work.

It would be even cooler if the mini drawer could automatically expand into a persistent drawer and vice-versa. Currently expanding the mini-drawer obscures some of the content.

Like this

@mikepenz
Copy link
Owner

mikepenz commented Oct 2, 2015

@timrae you can use the normal drawer and add it somewhere in your layout like done here:
https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/EmbeddedDrawerActivity.java

or you use the same mechanism shown with the MiniDrawer sample. this also does not move over the content.

@mikepenz mikepenz self-assigned this Oct 2, 2015
@timrae
Copy link
Author

timrae commented Oct 5, 2015

or you use the same mechanism shown with the MiniDrawer sample. this also does not move over the content.

hmm are you sure about that? I am using the same mechanism as the MiniDrawer example, and I just checked the sample app, which definitely moves the content (you can see that the text "embedded drawer" moves to the right and is no longer centered in the view when the drawer is open).

@timrae
Copy link
Author

timrae commented Oct 5, 2015

also the navigation icon in the action bar changes to a back button when I enable the MiniDrawer whereas in gmail I believe it is a hamburger which expands the MiniDrawer into a proper nav. drawer.

@timrae
Copy link
Author

timrae commented Oct 5, 2015

The left caret at the top of the drawer which folds it into MiniDrawer (as in pic in first post) would be cool as well if I were to be greedy :)

@mikepenz
Copy link
Owner

mikepenz commented Oct 5, 2015

@timrae i just published a new version of the Crossfader library which now allows you to disable the slide functionality, and which allows you to resize the content panel instead of moving it out of the screen.

The function of the ActionBarDrawerToggle can be managed by you, this is not limited or hardcoded by the drawer.

v1.1.0 of the Crossfader was just published to maven central it can take about 30 minutes to sync
https://github.com/mikepenz/Crossfader

@mikepenz
Copy link
Owner

@timrae i hope you like the new added persistent drawer sample:
https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/PersistentDrawerActivity.java

it showcases how to create a drawer like the one shown in the MaterialDesignGuidelines by using all the APIs the MaterialDrawer offers. It can even be used in RTL layout.

At the moment there are two bugs (but as this is not part of the lib but custom behavior you can achieve with the drawer it is possible to fix them without depending on the library itself):

  • on API 17 the header has a different height than the Toolbar (it is correct on API 10)
  • on API 10 the arrow to close the extended drawer is directly on the right without the padding (which is applied on higher api levels)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants