In my Android-App I've the following layout:
<CustomRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="@+id/image_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<OverScrollBounceScrollView
android:id="@+id/scrollview"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:id="@+id/user_profile_scroll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RelativeLayout
android:id="@+id/dummy_viewport"
android:layout_width="match_parent"
android:layout_height="350dp"
>
</RelativeLayout>
<LinearLayout
android:id="@+id/scroll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
>
...some content
</LinearLayout>
</LinearLayout>
</OverScrollBounceScrollView>
</CustomRelativeLayout>
It looks about this:
https://i.stack.imgur.com/lzL5u.png
My goals are:
- When I do a scroll in Y-direction I want the scrollview to take over and scroll normally
- When I scroll in X-direction I want the viewpager under the scrollview to take over
The problem now is, that the scrollview takes all the events and the viewpager can't be reached at all.
Any ideas on how to solve this?