shenbengit / PagerGridLayoutManager

基于RecyclerView实现网格分页LayoutManager——PagerGridLayoutManager
MIT License
244 stars 26 forks source link

当 item 刷新的时候无法滚动,是用场景是列表的进度更新 #11

Closed Wesley254619 closed 2 years ago

shenbengit commented 2 years ago

请展示实现效果或相关代码。未能明白您的意思。

Wesley254619 commented 2 years ago

场景是这样的,类似于手机应用市场里面的 App 批量更新,我们做的是两行两列,一页展示四个,然后左右滑动翻页。点击更新后需要在 item 上展示下载进度。现在问题是这样的,纯静态展示的情况下,可以左右滑动分页。但是在调用 notifyItemRangeChanged 或是 notifyDataSetChanged 去刷新item上的进度展示,就没办法左右滑动了,只能卡在当前页

Wesley254619 commented 2 years ago

https://user-images.githubusercontent.com/23516068/147399515-b9afb284-2886-4035-bf29-e4be26fa3083.mp4

shenbengit commented 2 years ago

是存在这个问题。调用Adapter中notifyXXX()相关方法时会间接调用LayoutManager.onLayoutChildren(),而我在onLayoutChildren()处理的方式为绘制上次页的且总以左上(0,0)开始布局,没有记录上次滑动的位置。后面会修复这个问题。

shenbengit commented 2 years ago

试下v1.1.3