Skip to content

Commit

Permalink
fix: only autoscroll on refresh to the top of the live screen if alre…
Browse files Browse the repository at this point in the history
…ady at the top.
  • Loading branch information
cbeyls committed Jan 5, 2024
1 parent 40e5d1e commit b571fc4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ sealed class LiveListFragment(
holder.isProgressBarVisible = false
// Ensure we stay at scroll position 0 so we can see the insertion animation
with(holder.recyclerView) {
if (scrollY == 0) scrollToPosition(0)
if ((layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() == 0) {
scrollToPosition(0)
}
}
}
}
Expand Down

0 comments on commit b571fc4

Please sign in to comment.