Status Update
Comments
am...@google.com <am...@google.com> #2
Hi,
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
lo...@gmail.com <lo...@gmail.com> #3
Thought I should mention for posterity, a temporary workaround is:
mStaggeredGridLayoutManager.setItemPrefetchEnabled(false);
mStaggeredGridLayoutManager.setItemPrefetchEnabled(false);
lo...@gmail.com <lo...@gmail.com> #4
[Comment deleted]
lo...@gmail.com <lo...@gmail.com> #5
The bug is reproduced on physical device.
1. RecyclerView with GridLayoutManager (3 column)
2. All items has span = 3 (grid look like simple list)
3. Scrolling up and down is working fine
4. Insert items in the middle of the list (All inserted items has span 3 too)
5. call to notifyDataChanged()
6. Grid is expanded with animation
6. Scrolling up and down is failed.
Problem is found after adding android:animateLayoutChanges="true" into a parent layout.
Bug reproducing is stable.
1. RecyclerView with GridLayoutManager (3 column)
2. All items has span = 3 (grid look like simple list)
3. Scrolling up and down is working fine
4. Insert items in the middle of the list (All inserted items has span 3 too)
5. call to notifyDataChanged()
6. Grid is expanded with animation
6. Scrolling up and down is failed.
Problem is found after adding android:animateLayoutChanges="true" into a parent layout.
Bug reproducing is stable.
am...@google.com <am...@google.com> #6
Bug reproduced id add "android:animateLayoutChanges="true" to list item layout:
RecycleView
--Root Item view layout is: RelativeLayout
----LinearLayout
--------ViewPager
----------Page0: is <LinearLayout... "android:animateLayoutChanges="true".../> <-- this attr is the bug reason
RecycleView
--Root Item view layout is: RelativeLayout
----LinearLayout
--------ViewPager
----------Page0: is <LinearLayout... "android:animateLayoutChanges="true".../> <-- this attr is the bug reason
au...@google.com <au...@google.com> #7
You cannot use android:animateLayoutChanges with RecyclerView.
It will try to animate children of the RecyclerView and conflict with the ItemAnimator.
You can still use TransitionManager directly (which that attribute uses) but make sure to exclude RecyclerView's children.
It will try to animate children of the RecyclerView and conflict with the ItemAnimator.
You can still use TransitionManager directly (which that attribute uses) but make sure to exclude RecyclerView's children.
lo...@gmail.com <lo...@gmail.com> #8
Hi, original reporter here. I did not use animateLayoutChanges. See example project in original report.
au...@google.com <au...@google.com> #9
sorry for the confusion, i've re-opened the ticket.
lo...@gmail.com <lo...@gmail.com> #11
it is fixed internally, so in the next release it should be fine.
am...@google.com <am...@google.com> #12
public class MyStaggerLayoutManager extends StaggeredGridLayoutManager {
public MyStaggerLayoutManager(int spanCount, int orientation) {
super(spanCount, orientation);
}
public MyStaggerLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void collectAdjacentPrefetchPositions(int dx, int dy, RecyclerView.State state, LayoutPrefetchRegistry layoutPrefetchRegistry) {
try {
super.collectAdjacentPrefetchPositions(dx, dy, state, layoutPrefetchRegistry);
} catch (IllegalArgumentException e) {
LogUtils.e("catch IllegalArgumentException");
}
}
}
i fixed it by using custom LayoutManager
public MyStaggerLayoutManager(int spanCount, int orientation) {
super(spanCount, orientation);
}
public MyStaggerLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void collectAdjacentPrefetchPositions(int dx, int dy, RecyclerView.State state, LayoutPrefetchRegistry layoutPrefetchRegistry) {
try {
super.collectAdjacentPrefetchPositions(dx, dy, state, layoutPrefetchRegistry);
} catch (IllegalArgumentException e) {
LogUtils.e("catch IllegalArgumentException");
}
}
}
i fixed it by using custom LayoutManager
Description
This is my understanding of the spec after reading
Granted I've made a modification so that the view is not in "shift mode" with 4 items. Most, if not everyone, I've shown the default implementation to thinks the shift mode looks bad. But I don't think I messed up anything as I've only changed the value of a private boolean field.
Please see the attached screenshot. Note there is no space between the + shield and bound of the text view "Safety".