Skip to content

Commit

Permalink
[FM] Fix random jumps in multi-selection mode
Browse files Browse the repository at this point in the history
Signed-off-by: Muntashir Al-Islam <[email protected]>
  • Loading branch information
MuntashirAkon committed Nov 18, 2024
1 parent ae13ba3 commit 291fa8c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ public void onItemRangeChanged(int positionStart, int itemCount) {
mAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataChangedObserver() {
@Override
public void onChanged() {
if (mAdapter.isInSelectionMode()) {
// Avoid setting a selection in selection mode (directory cannot be changed
// in selection mode anyway).
return;
}
if (scrollPosition.get() != RecyclerView.NO_POSITION) {
// Update scroll position
mRecyclerView.setSelection(scrollPosition.get());
Expand Down

0 comments on commit 291fa8c

Please sign in to comment.