[TEST] Initial force scroll only once
Change-Id: I6f5580be02fbdb13b56c5a180c124076bddcd52a
This commit is contained in:
parent
1fdb6923f5
commit
22cdb6544d
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue