title: Custom Animation for navigation drawer open and close
body: <p>Lets do something challanging. I have seen this animation for navigation Drawer :
  <a href="https://i.stack.imgur.com/rDQbg.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/rDQbg.gif" alt="enter image description here"></a></p>
  
  <p>and I would like to implement this as it is a great effect. I tried to get the effect by creating a custom view and on touch i am getting at least 50% similar effect. i would like to implement my ondraw() and ontouch() methods from my custom view to navigation view. How is that done? Any one have any clue? Can anyone give any link which has simlar stuff.</p>
  
  <p>I have tried this : </p>
  
  <pre><code>public class CustomNavigation extends DrawerLayout {
  
      public CustomNavigation(Context context) {
          super(context);
      }
  
      public CustomNavigation(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      public CustomNavigation(Context context, AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
  //        invalidate();
      }
      public void start()
      {
          this.invalidate();
          Log.d("Parth", "start");
      }
  
      @Override
      public void onDraw(Canvas c) {
          Log.d("Parth", "ondraw");
  //        super.onDraw(c);
  
      }
  
  }
  </code></pre>
  
  <p>The on draw method isn't called. why is that so?</p>
  
  <p>from the main activity i make an object of the class above and call the start method like this : </p>
  
  <pre><code>CustomNavigation drawer = (CustomNavigation) findViewById(R.id.drawer_layout);
  drawer.start();
  </code></pre>
  
  <p>and this is just the initial stuff, i also want to implement these : </p>
  
  <ul>
  <li><p><a href="https://mir-s3-cdn-cf.behance.net/project_modules/disp/1637a925685965.56349328a6a5e.gif" rel="noreferrer">https://mir-s3-cdn-cf.behance.net/project_modules/disp/1637a925685965.56349328a6a5e.gif</a></p></li>
  <li><p><a href="https://mir-s3-cdn-cf.behance.net/project_modules/disp/092d8f25685965.5634935a53dde.gif" rel="noreferrer">https://mir-s3-cdn-cf.behance.net/project_modules/disp/092d8f25685965.5634935a53dde.gif</a></p></li>
  </ul>