Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlowLayoutManager 当条目 match parent 时,上滑动时,闪退 #29

Open
zhaoyubetter opened this issue Jun 13, 2018 · 0 comments
Open

Comments

@zhaoyubetter
Copy link

zhaoyubetter commented Jun 13, 2018

感谢这个例子,在使用这个例子,发现了一个小问题:

感觉原因在顺序addChildView,设置 Rect 跳过了这块:

// 顺序addChildView
 // 计算宽度 包括margin
if (leftOffset + getDecoratedMeasurementHorizontal(child) <=
...

第二屏时,走:
// 新起一行的时候要判断一下边界
 if (topOffset - dy > getHeight() - getPaddingBottom()) {
             //越界了 就回收
            removeAndRecycleView(child, recycler);
            mLastVisiPos = i - 1;
}

这样导致了mItemRects 不完整,比如 1-8为第一屏,9-16,为第二屏,9 没有添加到 mItemRects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant