title: Facebook lide slideout menu (Not using that library)
body: <p>I want to have facebook like menu in my application. There are many threads on this and all of them suggest to use a library which actually just takes a screenshot of the screen and slides that image towards right so as to show menu on left hand side and slide image with some transition. But in that case, the layout on the right is not clickable since its an image.</p>
  
  <p>But I have some another way of doing it in which I have a <strong>Root Layout which</strong> already <strong>has Menu Layout and Content Layout</strong>. But root layout is set some negative margin towards left so it is not visible. Like this-</p>
  
  <p><img src="https://i.stack.imgur.com/ryYud.png" alt="Content when menu is not pressed"></p>
  
  <p>When user presses menu button, the Menu Layout is slid to the right and root layout's left margin is set to 0. So now what we see is this-</p>
  
  <p><img src="https://i.stack.imgur.com/c5EYu.png" alt="Content when menu is pressed and menu layout is shown"></p>
  
  <p>Now, <strong>The real problem starts here</strong></p>
  
  <p>I want to slide both the layouts with some animation. So when I animate the Menu layout &amp; Content Layout, the animation for both the layouts is not at same speed even if I am applying same animation to it. So I tried to <strong>Shift ROOT LAYOUT only</strong> towards right/left by setting margin to it. But on doing so nothing is shown on the screen. Where am I going wrong. The way I set margin is shown here-</p>
  
  <pre><code>int width = leftLayout.getWidth();
  isLayoutShown = !isLayoutShown;
  if(isLayoutShown){
      rootLayoutParams.setMargins(0, 0, 0, 0);
      rootLayout.setLayoutParams(rootLayoutParams);    
  }else{
      rootLayoutParams.setMargins(-width, 0, 0, 0);
      rootLayout.setLayoutParams(rootLayoutParams);
  }
  </code></pre>