mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-12 03:07:40 +03:00
When scrolled to the bottom, stick there
Change-Id: I0c788368afef04d7541f633cd830f5bdbf665049
This commit is contained in:
parent
3f448b48c7
commit
1bd59e3c1c
1 changed files with 2 additions and 1 deletions
|
@ -2255,8 +2255,9 @@ class RoomDetailFragment @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setInitialForceScrollEnabled(enabled: Boolean, stickToBottom: Boolean = false) {
|
private fun setInitialForceScrollEnabled(enabled: Boolean, stickToBottom: Boolean = false) {
|
||||||
|
val shouldStickToBottom = stickToBottom || (!enabled && !views.timelineRecyclerView.canScrollVertically(1))
|
||||||
scrollOnNewMessageCallback.initialForceScroll = enabled
|
scrollOnNewMessageCallback.initialForceScroll = enabled
|
||||||
if (stickToBottom) {
|
if (shouldStickToBottom) {
|
||||||
layoutManager.disablePreferredAnchorPlacement()
|
layoutManager.disablePreferredAnchorPlacement()
|
||||||
} else {
|
} else {
|
||||||
// (Re-) Enable preferred anchor placement
|
// (Re-) Enable preferred anchor placement
|
||||||
|
|
Loading…
Reference in a new issue