You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor: Migrate AdapterJoinedMember to ListAdapter
I've refactored `AdapterJoinedMember` from a standard `RecyclerView.Adapter` to `ListAdapter` to leverage `DiffUtil` for more efficient list updates.
- I changed the superclass to `ListAdapter<JoinedMemberData, ViewHolderUser>`.
- I added a `DiffUtil.ItemCallback` to handle item and content comparisons.
- I replaced manual `MutableList` management by having the adapter process new lists, which ensures they are handled immutably.
- I updated the `removeMember`, `updateLeadership`, and `updateData` methods to create new lists and pass them to the adapter, which triggers efficient, fine-grained UI updates.
- This change eliminates whole-list redraws caused by `notifyDataSetChanged()`, improving performance and simplifying the adapter's logic.
I also fixed compilation errors by:
- Updating the `AdapterJoinedMember` constructor call in `JoinedMemberFragment` to match the new signature.
- Adding the missing `RecyclerView` import in `AdapterJoinedMember`.
0 commit comments