Skip to content

There is some bug when working with RecyclerView placed as a child in LinearLayout with weight specified. When updating items in adapter the recyclerview scroll to the updated item and prevents user from scrolling.

License

Notifications You must be signed in to change notification settings

marcinbak/recyclerview_bug

Repository files navigation

The bug is solved with support library version 24.0.0!

recyclerview_bug

There is some bug when working with RecyclerView placed as a child in LinearLayout with weight specified. When updating items in adapter the recyclerview scroll to the updated item and prevents user from scrolling.

To produce behaviour just scroll down a little and tap on one of the items. A progress bar should show up and item should be updated.

Demo working

Demo failing

Where is the problem?

I've add two layouts for comparison: one working and one failing. You can compare activity_bug.xml and activity_ok.xml for differences.

 <android.support.v7.widget.RecyclerView
    android:id="@+id/recycler"
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:background="@android:color/holo_orange_light"/>

vs

<android.support.v7.widget.RecyclerView
      android:id="@+id/recycler"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/holo_orange_light"/>

About

There is some bug when working with RecyclerView placed as a child in LinearLayout with weight specified. When updating items in adapter the recyclerview scroll to the updated item and prevents user from scrolling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published