ScrollableView makes scrollable views under main layout unresponsive.
Created by: RlagoMan
In my project, I have a WebView in the main content and a ListView in the sliding up panel. The ListView is set as scrollableView in the SlidingUpPanelLayout. When I hide the sliding up panel, the WebView stops responding to scroll events in every point of the screen greater than the sliding up panel height. I solved this with a single check in the dispatchTouchEvent() method:
...
if (!isViewUnder(mScrollableView, (int) mInitialMotionX, (int) mInitialMotionY)) {
return super.dispatchTouchEvent(ev);
}
// Prevent the slidingUpPanel to block events when is hidden or collapsed.
// This causes errors on scrollable views under main content.
if(PanelState.COLLAPSED.equals(getPanelState()) || PanelState.HIDDEN.equals(getPanelState())) {
return super.dispatchTouchEvent(ev);
}
// Which direction (up or down) is the drag moving?
if (dy * (mIsSlidingUp ? 1 : -1) > 0) {
...
I have created a fork: https://github.com/RlagoMan/AndroidSlidingUpPanel
Hope this helps!