From b571fc4d77af942d40029af9e5b5b5b7101450d2 Mon Sep 17 00:00:00 2001 From: Christophe Beyls Date: Sat, 6 Jan 2024 00:50:13 +0100 Subject: [PATCH] fix: only autoscroll on refresh to the top of the live screen if already at the top. --- .../java/be/digitalia/fosdem/fragments/LiveListFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/be/digitalia/fosdem/fragments/LiveListFragment.kt b/app/src/main/java/be/digitalia/fosdem/fragments/LiveListFragment.kt index 47cbddbf..4c3344a8 100644 --- a/app/src/main/java/be/digitalia/fosdem/fragments/LiveListFragment.kt +++ b/app/src/main/java/be/digitalia/fosdem/fragments/LiveListFragment.kt @@ -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) + } } } }