You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues and confirmed this is not a duplicate
Issues and steps to reproduce
I use FlexboxLayoutManager with RecyclerView.Adapter to show short texts of roughly 4x20 on the screen at any time. To isolate the issue from data loading, I tested with a static set of items about 1000 loaded. As I scroll down, new items are shown from below and older items go out from the top. When I scroll fast, the views become very sluggish and jittery with abrupt stops in between. Interestingly, the sluggishness only seems to happen when I scroll down (scrolling up appears much better), even scrolling down again after having scrolled back up.
As I browsed through the code, without fully comprehending it, I found something I can't explain. In FlexboxLayoutManager.java, view cache is cleared while scrolling:
@Override
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler,
RecyclerView.State state) {
if (isMainAxisDirectionHorizontal() ||
(mFlexWrap == FlexWrap.NOWRAP && !isMainAxisDirectionHorizontal())) {
int scrolled = handleScrollingMainOrientation(dy, recycler, state);
mViewCache.clear();
return scrolled;
} else {
int scrolled = handleScrollingSubOrientation(dy);
mAnchorInfo.mPerpendicularCoordinate += scrolled;
mSubOrientationHelper.offsetChildren(-scrolled);
return scrolled;
}
}
I commented out the line mViewCache.clear(); in my local copy, then things appear drastically improved for me, at least scrolling down again becomes very smooth, though I don't know yet if it would cause other problems.
Version of the flexbox library
3.0.0
The text was updated successfully, but these errors were encountered:
LeoXJ978
changed the title
Scroll vert sluggish and jittery with roughly 4x20 items on the screen
Scroll view sluggish and jittery with roughly 4x20 items on the screen
Dec 7, 2021
LeoXJ978
changed the title
Scroll view sluggish and jittery with roughly 4x20 items on the screen
Scroll view sluggish and jittery
Dec 7, 2021
Issues and steps to reproduce
I use FlexboxLayoutManager with RecyclerView.Adapter to show short texts of roughly 4x20 on the screen at any time. To isolate the issue from data loading, I tested with a static set of items about 1000 loaded. As I scroll down, new items are shown from below and older items go out from the top. When I scroll fast, the views become very sluggish and jittery with abrupt stops in between. Interestingly, the sluggishness only seems to happen when I scroll down (scrolling up appears much better), even scrolling down again after having scrolled back up.
I have a RecyclerView within a LinearLayout, as
Each item for the RecyclerView is defined as:
In Java code,
Expected behavior
I expect to see smoother scrolling
As I browsed through the code, without fully comprehending it, I found something I can't explain. In FlexboxLayoutManager.java, view cache is cleared while scrolling:
I commented out the line
mViewCache.clear();
in my local copy, then things appear drastically improved for me, at least scrolling down again becomes very smooth, though I don't know yet if it would cause other problems.Version of the flexbox library
3.0.0
The text was updated successfully, but these errors were encountered: