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

框架设计咨询 #107

Closed
KingShing opened this issue Dec 15, 2021 · 1 comment
Closed

框架设计咨询 #107

KingShing opened this issue Dec 15, 2021 · 1 comment

Comments

@KingShing
Copy link

大佬可以咨询2个关于PureMusic项目的问题吗:
1) com.kunminx.binding_recyclerview.adapter.BaseDataBindingAdapter 的 viewholder中 ViewDataBinding 没有调用setLifecycleOwner(),item随着滑动被销毁不需要移除掉观察者吗

2)BaseDataBindingAdapter 中只有一个 submitList(list),只能全量替换列表,databinding中如何 只更新某个position 的item呢,以及 insert ,remove等单个操作,都是整个list替换吗?

@KingShing
Copy link
Author

  1. setLifecycleOwner 是为了LiveData用的,viewHolder中的 item 数据 不是可观察的,此时不用setLifecycleOwner
  2. 即使直接替换list,DiffUtil和rv内部也会去差量更新

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

No branches or pull requests

1 participant