square / mortar

A simple library that makes it easy to pair thin views with dedicated controllers, isolated from most of the vagaries of the Activity life cycle.
Apache License 2.0
2.16k stars 156 forks source link

Integration with navigation drawer #79

Open wuman opened 10 years ago

wuman commented 10 years ago

This is a feature request.

Navigation drawer is quite commonly used in apps. I think it would be really helpful if the sample app could include implementation for integrating with the navigation drawer (or perhaps share how Square handles this).

One tricky thing is that an owner of the navigation drawer (much like the implementation of ActionBarOwner) should be called in both directions: calling from a second-level child screen to the Activity to disable the swipe gesture, and calling from the Activity to the navigation drawer owner to syncState() and handle onConfigurationChanged().

balysv commented 10 years ago

I've recently experimented with the Navigation Drawer integration and made an example app for that purpose.

It basically copies the ActionBarOwner pattern to change the state of the drawer. Communication from the Activity to the drawer is achieved by having the main content frame a DrawerLayout and calling it's methods directly.

irichardson commented 9 years ago

@balysv Any further development of this since the upgrade?