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

How to use a single drawer for every activity #341

Closed
jd-alexander opened this issue May 22, 2015 · 4 comments
Closed

How to use a single drawer for every activity #341

jd-alexander opened this issue May 22, 2015 · 4 comments
Assignees
Labels

Comments

@jd-alexander
Copy link

I want to use the material drawer in all activities instead of using a fragment based navigation. I explored the samples and I also saw that the library inflates the drawer layout but im not sure how to go about configuring it. What I have done so far is to create a base activity with the drawer then extend other activities from it but when I do the drawer isn't available so can I get some guidance. Thanks.

@mikepenz
Copy link
Owner

This is no valid navigation pattern. The drawer should only be available in the root activity. if there are different views in the root you should use fragments. if you jump to other activites those should not have a drawer.

still you can do this with the drawer. but i highly recommend to do it like it should be done.

@mikepenz mikepenz self-assigned this May 22, 2015
@ammargitham
Copy link

Hi Mike,

Although I agree with you that a navigation drawer in any other activity other than the root is kind of not a valid navigation pattern, but Google itself uses this pattern in the Play Store app. Go into the detail activity of an app, then swipe from the left edge to reveal the drawer. There is no indication of a drawer being there, but it's there.

@mikepenz
Copy link
Owner

@ammar786-1 i know ;). it was just a hint to follow the guidelines (and we all know google itself doesn't do this :P)

about the main issue. I think the BaseActivity he has written must be wrong, there is no thing in the Drawer which should prevent this.

In fact it should work exactly as in any other default activity. as seen in the sample app.

@raghunandankavi2010
Copy link

@mikepenz But the google io schedule app has drawer in all activities although they finish the activity when you navigate to different screen probably to avoid complexities of back pattern. Google should maintain one valid pattern across all it apps.

@ammar786-1 In case you want the drawer in all activities Follow Google io Schedule app on github. It has a BaseActivity from which all activites extend. Also do make changes like extending AppCompatActivity and themes...

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

4 participants