Stop NestedScrollView inside ViewPager to process horizontal scrolls
<p>I am trying to implement a view that is composed by a CoordinatorLayout with a ViewPager, and the NestedScroolViews are inside each ViewPager. I managed to make the Toolbar hide on scrolls, but I've been having the following issue:</p>

<p>Whenever I swipe left or right to change the content of the view pager, the gesture is forwarded to the NestedScrollView that sometimes registers a very small vertical scroll. It is small, but enough to be annoying.</p>

<p>This should explain the problem better:</p>

<p><a href="https://i.stack.imgur.com/Efeio.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Efeio.gif" alt="Example of behavior"></a></p>

<p>Video: <a href="https://youtu.be/BGqynDDL68I" rel="nofollow noreferrer">https://youtu.be/BGqynDDL68I</a></p>

<p>I've tried extending the NestedScrollView to block the scroll/fling methods but no success.</p>

<p>Has anybody gone through the same issue?</p>

<p><strong>EDIT 1 : Code</strong></p>

<p>Activity:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.design.widget.CoordinatorLayout
    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"
    tools:context="main.MainActivity"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;!--&lt;include layout="@layout/main__activitycontent"/&gt;--&gt;

    &lt;android.support.design.widget.AppBarLayout
        android:id="@+id/id_appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/AppTheme.AppBarOverlay"&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/main__toolbar"
            android:fitsSystemWindows="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/AppTheme.PopupOverlay"/&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;


    &lt;FrameLayout
        android:id="@+id/main__fragment_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        /&gt;

    &lt;android.support.design.widget.TabLayout

        android:id="@+id/main__navigations_tablayout"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:layout_gravity="bottom"
        android:background="@color/main__tabbar_button_color"
        app:layout_behavior="utils.views.TabLayoutBehaviour"
        app:tabIndicatorColor="@android:color/white"
        app:tabSelectedTextColor="@color/main__tabbar_selected_color"
        app:tabTextColor="@color/main__tabbar_normal_color"
        &gt;


    &lt;/android.support.design.widget.TabLayout&gt;

&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>

<p>Fragment With ViewPager</p>

<pre><code>&lt;android.support.v4.view.ViewPager
    android:id="@+id/meditationpager__pager"

    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"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    /&gt;
</code></pre>

<p>Inner Fragment:</p>

<pre><code>&lt;android.support.v4.widget.NestedScrollView
    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"
    android:background="@android:color/white"
    android:fillViewport="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="main.MainActivity"
    tools:showIn="@layout/main__activity"&gt;

    &lt;LinearLayout
        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="wrap_content"
        android:orientation="vertical"
        tools:context="domain.screens.readmeditation.MeditationFragment"&gt;


        &lt;TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/large_text"/&gt;

    &lt;/LinearLayout&gt;
&lt;/android.support.v4.widget.NestedScrollView&gt;
</code></pre>