AppBarLayout & NestedScrollView with dynamic content
<p>Here is video that describes my problem: <a href="https://www.youtube.com/watch?v=p1fcDbL1kcI&amp;feature=youtu.be" rel="nofollow">click</a></p>

<p>Current layout xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout
    ... &gt;

    &lt;android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/colorPrimary"
        android:animateLayoutChanges="true"
        app:title="@string/app_name"
        app:theme="@style/Toolbar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Dark"
        app:layout_scrollFlags="scroll|enterAlwaysCollapsed|snap"/&gt;

    &lt;android.support.design.widget.CoordinatorLayout
        android:id="@+id/coordinator_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"&gt;

        &lt;android.support.v4.widget.NestedScrollView
            android:id="@+id/content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;

        &lt;android.support.design.widget.AppBarLayout
            android:id="@+id/app_bar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"&gt;

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

        ...

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

&lt;/LinearLayout&gt;
</code></pre>

<p><code>View</code> to <code>AppBarLayout</code> adds dynamically while execution.
When I scroll to the top of <code>ScrollView</code> and then update <code>NestedScrollView</code> &amp; <code>AppBarLayout</code> content, everything works as it should. But when I scroll down and then trying to update content, <code>AppBarLayout</code> broken before I scroll to the top of <code>NestedScrollView</code>.</p>

<p>Scroll to the top of <code>NestedScrollView</code> before updating <code>NestedScrollView</code> &amp; <code>AppBarLayout</code> with this method does not help:</p>

<pre><code>public void scrollContentToTop() {
    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams();
    AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior();
    if (behavior != null) {
        behavior.onNestedFling(coordinatorLayout, appBarLayout, null, 0, 0, true);
    }
}
</code></pre>

<p><strong>Any ideas?</strong></p>