Skip to content

Commit

Permalink
Post the show call to UI thread
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Oct 1, 2024
1 parent cdd623e commit c29c5fd
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,14 @@ public void onLayoutChange(View v, int l, int t, int r, int b, int ol, int ot, i
public boolean scrollToAndFlash(final File file) {
final int pos = getFilePosition(file);
if (pos >= 0 && _layoutManager != null) {
doAfterChange(() -> _recyclerView.postDelayed(() -> {
final RecyclerView.ViewHolder holder = _recyclerView.findViewHolderForLayoutPosition(pos);
if (holder != null) {
GsContextUtils.blinkView(holder.itemView);
}
}, 400));
_layoutManager.scrollToPosition(pos);
_recyclerView.post(() ->
_recyclerView.postDelayed(() -> {
final RecyclerView.ViewHolder holder = _recyclerView.findViewHolderForLayoutPosition(pos);
if (holder != null) {
GsContextUtils.blinkView(holder.itemView);
}
}, 400));
return true;
}
return false;
Expand Down Expand Up @@ -782,7 +783,7 @@ private synchronized void _loadFolder(final @NonNull File folder, final @Nullabl
}
});
} else if (toShow != null && _adapterDataFiltered.contains(toShow)) {
scrollToAndFlash(toShow);
_recyclerView.post(() -> scrollToAndFlash(toShow));
}
}

Expand Down

0 comments on commit c29c5fd

Please sign in to comment.