title: How to slide the ActionBar along with the NavigationDrawer
body: <p>What I want to do is slide the <code>ActionBar</code> along with the <code>NavigationDrawer</code> when the drawer is opened. I am currently not using any third party libraries and if at all possible I want to keep it that way. All i need is an implementation of method like: <code>getActionBarView.slide(dp);</code></p>
  
  <p>This is the code I currently use to create the <code>NavigationDrawer</code>:</p>
  
  <pre><code>mDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
  
      public void onDrawerClosed(View view) {
          invalidateOptionsMenu();
  
          // calling onPrepareOptionsMenu() to hide action bar icons
      }
  
      @Override
      public void onDrawerSlide(View drawerView, float slideOffset) {
          if (getDeviceType(getApplicationContext()) == DEVICE_TYPE_PHONE) {
              drawerLayout.setScrimColor(Color.parseColor("#00FFFFFF"));
              float moveFactor = (listView.getWidth() * slideOffset);
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB) {
                  all_menu_container_parent.setTranslationX(moveFactor);
              } else {
                  TranslateAnimation anim = new TranslateAnimation(lastTranslate, moveFactor, 0.0f, 0.0f);
                  anim.setDuration(0);
                  anim.setFillAfter(true);
                  all_menu_container_parent.startAnimation(anim);
  
                  lastTranslate = moveFactor;
              }
          }
      }
  
      public void onDrawerOpened(View drawerView) {
          // calling onPrepareOptionsMenu() to hide action bar icons
      }
  };
  drawerLayout.setDrawerListener(mDrawerToggle);
  </code></pre>
  
  <p>But it doesn't do what I want, it produces this:</p>
  
  <p><img src="https://i.stack.imgur.com/zf6Hi.png" alt="I am currently stuck with this"></p>
  
  <p>What I want to achieve is this:</p>
  
  <p><img src="https://i.stack.imgur.com/CfHSX.png" alt="current screen shot from app"></p>