diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-04-06 17:12:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 17:12:16 +0200 |
commit | e9ba45e2bd33129758e8a358ccd4c20d34f45284 (patch) | |
tree | 18b545098645cfe01082628342b80c49d9311666 /app | |
parent | ee69e8c66bf0e734db8770efd9ad512491ce546a (diff) | |
download | AntennaPod-e9ba45e2bd33129758e8a358ccd4c20d34f45284.zip |
Avoid scrolling screen on refresh (#6413)
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java index 1384b5d78..f5221d47b 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java @@ -426,13 +426,16 @@ public abstract class EpisodesListFragment extends Fragment .observeOn(AndroidSchedulers.mainThread()) .subscribe( data -> { + final boolean restoreScrollPosition = episodes.isEmpty(); episodes = data.first; hasMoreItems = !(page == 1 && episodes.size() < EPISODES_PER_PAGE); progressBar.setVisibility(View.GONE); listAdapter.setDummyViews(0); listAdapter.updateItems(episodes); listAdapter.setTotalNumberOfItems(data.second); - recyclerView.restoreScrollPosition(getPrefName()); + if (restoreScrollPosition) { + recyclerView.restoreScrollPosition(getPrefName()); + } updateToolbar(); }, error -> { listAdapter.setDummyViews(0); |