diff --git a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java index 91539f1327..23843a9f3b 100644 --- a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java +++ b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java @@ -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; @@ -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)); } }