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.
I'm using this library from @ChrisBanes: https://github.com/chrisbanes/ActionBar-PullToRefresh
In my home activity layout I have a navigation drawer
<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" >
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.
I have been going though the code and I noticed that the layout gets added like this:
// 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);
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.
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.
Thanks in advance.