diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt index 884ef1812e..d4e4a51d81 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt @@ -70,6 +70,7 @@ class ScrollOnNewMessageCallback(private val layoutManager: BetterLinearLayoutMa } if (scrollToEvent == null) { layoutManager.scrollToPositionWithOffset(0, 0) + initialForceScroll = false layoutManager.setPreferredAnchorPosition(0) } else { timelineEventController.searchPositionOfEvent(scrollToEvent)?.let { @@ -78,6 +79,7 @@ class ScrollOnNewMessageCallback(private val layoutManager: BetterLinearLayoutMa // from the bottom of the view, not the top). val scrollToPosition = max(it + scrollOffset + 1, 0) layoutManager.scrollToPositionWithOffset(scrollToPosition, (parentView.measuredHeight * RoomDetailFragment.TARGET_SCROLL_OUT_FACTOR).toInt()) + initialForceScroll = false layoutManager.setPreferredAnchorPosition(scrollToPosition) } }