When scrolled to the bottom, stick there

Change-Id: I0c788368afef04d7541f633cd830f5bdbf665049
This commit is contained in:
SpiritCroc 2021-11-15 18:03:22 +01:00
parent 3f448b48c7
commit 1bd59e3c1c

View file

@ -2255,8 +2255,9 @@ class RoomDetailFragment @Inject constructor(
}
private fun setInitialForceScrollEnabled(enabled: Boolean, stickToBottom: Boolean = false) {
val shouldStickToBottom = stickToBottom || (!enabled && !views.timelineRecyclerView.canScrollVertically(1))
scrollOnNewMessageCallback.initialForceScroll = enabled
if (stickToBottom) {
if (shouldStickToBottom) {
layoutManager.disablePreferredAnchorPlacement()
} else {
// (Re-) Enable preferred anchor placement