mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-24 07:08:09 +00:00
Fixed weird scrolling position in conversation after going into info and going back
This commit is contained in:
parent
52e7acb4ee
commit
bd2936b05e
1 changed files with 8 additions and 2 deletions
|
|
@ -648,6 +648,7 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
viewModel.updateCurrentlyDisplayedConversation()
|
||||
|
||||
if (viewModel.scrollingPosition != SCROLLING_POSITION_NOT_SET) {
|
||||
Log.d("$TAG Restoring previous scrolling position: ${viewModel.scrollingPosition}")
|
||||
binding.eventsList.scrollToPosition(viewModel.scrollingPosition)
|
||||
}
|
||||
|
||||
|
|
@ -680,8 +681,13 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
Log.e("$TAG Failed to unregister data observer to adapter: $e")
|
||||
}
|
||||
|
||||
val layoutManager = binding.eventsList.layoutManager as LinearLayoutManager
|
||||
viewModel.scrollingPosition = layoutManager.findFirstCompletelyVisibleItemPosition()
|
||||
if (viewModel.isUserScrollingUp.value == true) {
|
||||
val layoutManager = binding.eventsList.layoutManager as LinearLayoutManager
|
||||
viewModel.scrollingPosition = layoutManager.findFirstCompletelyVisibleItemPosition()
|
||||
Log.d("$TAG Storing current scrolling position: ${viewModel.scrollingPosition}")
|
||||
} else {
|
||||
viewModel.scrollingPosition = SCROLLING_POSITION_NOT_SET
|
||||
}
|
||||
|
||||
val bottomSheetBehavior = BottomSheetBehavior.from(binding.messageBottomSheet.root)
|
||||
bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallback)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue