Skip to content

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

@zhaoyubetter

Description

@zhaoyubetter

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions