We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Banner放在MotionLayout中做动画,MotionLayout对应的layoutDescription:motion scene文件操作包裹Banner的Constraint开始结束设置关键属性visibility,最容易复现,基本是百分之百复现 复现之后,滑动一下Banner(也就是滑动一下RecyclerView)之后,onBindViewHolder方法才会被调用 如果Banner用RecyclerView代替,操作后再调用notifyItemChanged其onBindViewHolder可以被正常调用 [为此我做了一个demo来对比两者的不同表现(其中的item操作事件放在了onBindViewHolder方法中,是因为在onCreateViewHolder中获取postion也有问题,有时候会返回-1,而且正常情况也会返回错误,比如holder.getBindingAdapterPosition(),故放在onBindViewHolder)
MotionLayoutBannerTestApplication.zip
The text was updated successfully, but these errors were encountered:
notifyItemChanged的position不对,需要用holder的position,onBindView返回的position是数据的position不是holder的position,而且需要注意的是对于头尾两个数据需要刷新两个item。 例如3条数据对应的item的数据是五条:2,0,1,2,0,此时点击第一个0刷新时,notifyItemChanged的position是1而不是0,而且要刷新两个position(1和4)。
Sorry, something went wrong.
No branches or pull requests
Banner放在MotionLayout中做动画,MotionLayout对应的layoutDescription:motion scene文件操作包裹Banner的Constraint开始结束设置关键属性visibility,最容易复现,基本是百分之百复现
复现之后,滑动一下Banner(也就是滑动一下RecyclerView)之后,onBindViewHolder方法才会被调用
如果Banner用RecyclerView代替,操作后再调用notifyItemChanged其onBindViewHolder可以被正常调用
[为此我做了一个demo来对比两者的不同表现(其中的item操作事件放在了onBindViewHolder方法中,是因为在onCreateViewHolder中获取postion也有问题,有时候会返回-1,而且正常情况也会返回错误,比如holder.getBindingAdapterPosition(),故放在onBindViewHolder)
MotionLayoutBannerTestApplication.zip
The text was updated successfully, but these errors were encountered: