Revert "[TEST] Initial force scroll only once"

Keep in mind that the position can change while we insert events, so we
want to keep it up-to-date.

This reverts commit 22cdb6544d6cb35b64d634834f0a2999b8181ece.

Change-Id: I43f391c14aeb087c7d3cc71c5c6af3fbabe0f835
This commit is contained in:
SpiritCroc 2021-11-02 09:09:08 +01:00
parent 6c99527ab8
commit 37d0b5098f

View File

@ -70,7 +70,6 @@ class ScrollOnNewMessageCallback(private val layoutManager: BetterLinearLayoutMa
}
if (scrollToEvent == null) {
layoutManager.scrollToPositionWithOffset(0, 0)
initialForceScroll = false
layoutManager.setPreferredAnchorPosition(0)
} else {
timelineEventController.searchPositionOfEvent(scrollToEvent)?.let {
@ -79,7 +78,6 @@ 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)
}
}