title: Using android pull to refresh library draws layout on top of navigation drawer
body: <p>I'm using a pull to refresh library, which I know is deprecated, but unfortunately the client I'm working for is reluctant to change it so I'm unable to do so.</p>
  
  <p>I'm using this library from @ChrisBanes: 
  <a href="https://github.com/chrisbanes/ActionBar-PullToRefresh" rel="nofollow">https://github.com/chrisbanes/ActionBar-PullToRefresh</a></p>
  
  <p>In my home activity layout I have a navigation drawer</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      android:id="@+id/drawer_layout"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/white" &gt;
  </code></pre>
  
  <p>The problem I have is that no matter what I do, the layout that gets added to the view hierarchy for the pull to refresh functionality always gets drawn on top of everything else, so that includes the navigation drawer, so whenever you have the drawer open and a refresh is going on, you always have the progress bar and the pull to refresh layout drawing on top of my navigation drawer layout.</p>
  
  <p>I have been going though the code and I noticed that the layout gets added like this:</p>
  
  <pre><code>// Create LayoutParams for adding the View as a panel
  WindowManager.LayoutParams wlp = new WindowManager.LayoutParams(width, height,
      WindowManager.LayoutParams.TYPE_APPLICATION_PANEL,
      WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
      PixelFormat.TRANSLUCENT);
  wlp.x = 0;
  wlp.y = mRect.top;
  wlp.gravity = Gravity.TOP;
  
  // Workaround for Issue #182
  headerView.setTag(wlp);
  
  mActivity.getWindowManager().addView(headerView, wlp);
  </code></pre>
  
  <p>I haven't really got a complete understanding of how the window manager works, but I'm not sure if the layout should be added to another view or if there is another property I'm missing that would allow me to modify the z-index of this layout, and unfortunately I'm even unable to see this layout on hierarchy viewer.</p>
  
  <p>I would really appreciate any help on this matter as I have been struggling with this for a couple of days without being able to solve it.</p>
  
  <p>Thanks in advance.</p>