Hiding contexual action bar while navigation drawer is open

后端 未结 3 1400
小鲜肉
小鲜肉 2021-01-02 04:17

The question is similar to this except for the fact that instead of using a View Pager (VP) I want to use a Navigation Drawer (ND). I have a list of elements that activates

3条回答
  •  青春惊慌失措
    2021-01-02 04:56

    If you're using a material design styled navigation drawer, the accepted solution doesn't look all that nice as the ActionMode sits on top of the drawer until it's fully open.

    An alternative is to use onDrawerStateChanged instead, then as soon as you start dragging the drawer it will hide the ActionMode:

    @Override
    public void onDrawerStateChanged(int newState) {
        super.onDrawerStateChanged(newState);
        mActionMode.finish();
    }
    

提交回复
热议问题