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

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

Closed
Wesley254619 opened this issue Dec 25, 2021 · 5 comments
Labels

Comments

@Wesley254619
Copy link

No description provided.

@shenbengit
Copy link
Owner

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

@Wesley254619
Copy link
Author

Wesley254619 commented Dec 26, 2021

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

@Wesley254619
Copy link
Author

Wesley254619 commented Dec 26, 2021

1640494755734539.mp4

@shenbengit
Copy link
Owner

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

@shenbengit
Copy link
Owner

试下v1.1.3

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

No branches or pull requests

2 participants