I have a strange issue with NestedScrollView fling on Nexus 5x (7.1.2) and Google Pixel (7.1.1). On other OS versions it works OK.
Fling animation sometimes stops right after lifting up a finger. It stucks and the next few flings may be stopping as well. In order to reproduce it, you need to fling several times up and down.
In logs these flings look pretty much the same in terms of velocity, direction, etc, so I can't find a real cause of this bug.
Also NestedScrollView
doesn't necessarily need to be inside of CoordinatorLayout
, it also can have no NestedScrollingChild
at all.
For example, this bug is reproducible with one of the following NestedScrollView
children:
1) LinearLayout
populated with TextViews
2) WebView
3) LinearLayout
populated with RecyclerViews
.
I know about possible issues with RecyclerView
and Behaviours inside of CoordinatorLayout
, but it's not related.
So please don't mention any
recyclerView.getLayoutManager().setAutoMeasureEnabled(true);
recyclerView.setNestedScrollingEnabled(false);
or things like that.
Code sample:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="Put a super long text here"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="Put a super long text here"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>