0

New apps from Google, with Material Design, that use a Contextual Action Mode together with a Navigation Drawer. Starting to swipe the NavigationView in, will temporary hide the ActionMode which will be re-enabled when the drawer is closed again.

In this video: navigation drawer in gmail - look at the toolbar changing because of the navigation drawer swipe.

But how to implement this behavior? The only callback from NavigationView is OnNavigationItemSelected but what we need is maybe a callback from starting to open the drawer and then finishing closing it.

Could other solutions exist, that elude me? For example:

  • perhaps draw a new toolbar over instead disabling the CAB?
  • or even is it possible to make the CAB only overlay the Toolbar but not the NavigationView (question still open here?)

I am using:

  • com.android.support:appcompat-v7:23.4.0
  • com.android.support:design:23.4.0
  • android.support.design.widget.NavigationView
  • android.support.v7.view.ActionMode
Community
  • 1
  • 1
RumburaK
  • 1,985
  • 1
  • 21
  • 30
  • 1
    I can't get to your linked video, but if by "swipe" you mean opening and closing the drawer, `DrawerLayout` provides the [`DrawerListener`](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.DrawerListener.html) interface. – Mike M. Jun 15 '16 at 02:54
  • Thank you! Good start. And apologies for the video it's now accessible – RumburaK Jun 15 '16 at 18:52

0 Answers0