RecyclerView automatically scrolls to WebView/Fresco SimpleDraweeView item

Viewed 1636

When I put an item with asynchronically loaded content with expandable height, such as WebView or Fresco's SimpleDraweeView, the view sometimes scrolls to this item (if it's for example just partially visible on the screen, it scrolls to it after item is loaded). Have someone experienced this issue?

1 Answers

Put android:descendantFocusability="beforeDescendants" in your layout XML. This will prevent scrolling to asynchronously loaded contents.

<android.support.v7.widget.RecyclerView
            android:id="@+id/my_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:descendantFocusability="beforeDescendants" />
Related