mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-21 05:38:49 +03:00
Ensure we don't stick-to-bottom while paginating
Change-Id: I7e8a434ed1699ac238c0711c52499f0a124f60ab
This commit is contained in:
parent
1785e09e5a
commit
fe599576b5
1 changed files with 5 additions and 1 deletions
|
@ -3014,7 +3014,11 @@ class TimelineFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun setInitialForceScrollEnabled(enabled: Boolean, stickToBottom: Boolean = false) {
|
||||
val shouldStickToBottom = stickToBottom || (!enabled && !views.timelineRecyclerView.canScrollVertically(1))
|
||||
val shouldStickToBottom = stickToBottom ||
|
||||
(!enabled &&
|
||||
!views.timelineRecyclerView.canScrollVertically(1) &&
|
||||
!timelineViewModel.timeline.hasMoreToLoad(Timeline.Direction.FORWARDS)
|
||||
)
|
||||
scrollOnNewMessageCallback.initialForceScroll = enabled
|
||||
if (shouldStickToBottom) {
|
||||
layoutManager.disablePreferredAnchorPlacement()
|
||||
|
|
Loading…
Add table
Reference in a new issue