Skip to content

Commit

Permalink
optimize SelectableHelper
Browse files Browse the repository at this point in the history
- clear disable RecyclerView item view cache
- optimize method: 'deselect(int)'
  • Loading branch information
jrfeng committed Oct 29, 2020
1 parent aee834e commit 6ee4df1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public void attachToRecyclerView(@NonNull RecyclerView recyclerView) {
NonNullHelper.requireNonNull(recyclerView);

mRecyclerView = recyclerView;
mRecyclerView.setItemViewCacheSize(0);
registerAdapterDataObserver();
}

Expand Down Expand Up @@ -296,6 +295,8 @@ private void deselect(int position) {
if (holder != null) {
Selectable selectable = (Selectable) holder;
selectable.onUnselected();
} else {
mAdapter.notifyItemChanged(position);
}
}

Expand Down

0 comments on commit 6ee4df1

Please sign in to comment.