I have a relative layout that has a horizontal scrolling image viewer. The issue is that the parent view of this relative layout is also a SwipeToRefreshLayout so when the user scrolls down slightly it starts ac. See code:
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/item_activity_swipe_refresh_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".item.ItemActivity">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/item_activity_coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
android:id="@+id/item_activity_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:elevation="0dp"
app:theme="@style/ToolbarStyle">
<!-- This is the view I dont want to handle Swipe to refresh/Scroll content up (Scrolling down the screen) -->
<RelativeLayout
android:id="@+id/scrollable_image_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<!-- ....omit other code -->
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
I want the above Relative layout to basically pass all other gestures besides dragging your finger down and activating the Scroll to refresh. I need that view to handle horizontal scrolling (which it does already but if the user scrolls at a slight angle downwards. It slides the image viewers slightly but also starts the swipe to refresh.
i've had a look at this https://developer.android.com/training/gestures/viewgroup.html but its boggling my mind and am not sure if its even the right thing i should be looking at?
Has anyone else had to handle horizontal scrolling images or anything in a swipe to refresh layout?
Please help :(