ZLayoutManager icon indicating copy to clipboard operation
ZLayoutManager copied to clipboard

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

Open zhaoyubetter opened this issue 7 years ago • 0 comments

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

感觉原因在顺序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

zhaoyubetter avatar Jun 13 '18 05:06 zhaoyubetter