/**
   * Set a {@link Toolbar} to act as the {@link android.support.v7.app.ActionBar}ActionBar for this
   * Activity window. You must take care of hiding the old {@link Toolbar} if necessary.
   *
   * @param toolbar Toolbar to set as the Activity's action bar
   */
  @Override
  public void setSupportActionBar(@Nullable Toolbar toolbar) {
    if (toolbar != null) {
      if (toolbar != mDefaultToolbar && mDefaultToolbar.getVisibility() != View.GONE) {
        mDefaultToolbar.setVisibility(View.GONE);
      }

      super.setSupportActionBar(toolbar);

      mDrawerToggle =
          new ActionBarDrawerToggle(
              this,
              mDrawer,
              toolbar,
              R.string.md_content_description_drawer_open,
              R.string.md_content_description_drawer_close) {
            public void onDrawerClosed(View view) {
              invalidateOptionsMenu();
            }

            public void onDrawerOpened(View drawerView) {
              invalidateOptionsMenu();
            }
          };
      mDrawerToggle.syncState();
      mDrawer.setDrawerListener(mDrawerToggle);
    }
  }