mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Fix bubbles jumping around when entering selection mode.
This commit is contained in:
@@ -61,6 +61,9 @@ open class InsetAwareConstraintLayout @JvmOverloads constructor(
|
||||
private var overridingKeyboard: Boolean = false
|
||||
private var previousKeyboardHeight: Int = 0
|
||||
|
||||
val isKeyboardShowing: Boolean
|
||||
get() = previousKeyboardHeight > 0
|
||||
|
||||
init {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(this) { _, windowInsetsCompat ->
|
||||
applyInsets(windowInsets = windowInsetsCompat.getInsets(windowTypes), keyboardInsets = windowInsetsCompat.getInsets(keyboardType))
|
||||
|
||||
@@ -1868,18 +1868,21 @@ class ConversationFragment :
|
||||
val additionalScrollOffset = 54.dp
|
||||
if (isVisible) {
|
||||
ViewUtil.animateIn(bottomActionBar, bottomActionBar.enterAnimation)
|
||||
container.hideInput()
|
||||
inputPanel.setHideForSelection(true)
|
||||
animationsAllowed = false
|
||||
|
||||
bottomActionBar.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
|
||||
override fun onPreDraw(): Boolean {
|
||||
if (bottomActionBar.height == 0 && bottomActionBar.visible) {
|
||||
return false
|
||||
}
|
||||
|
||||
bottomActionBar.viewTreeObserver.removeOnPreDrawListener(this)
|
||||
val bottomPadding = bottomActionBar.height + 18.dp
|
||||
|
||||
val bottomPadding = bottomActionBar.height + ((bottomActionBar.layoutParams as? ViewGroup.MarginLayoutParams)?.bottomMargin ?: 18.dp)
|
||||
ViewUtil.setPaddingBottom(binding.conversationItemRecycler, bottomPadding)
|
||||
binding.conversationItemRecycler.scrollBy(0, -(bottomPadding - additionalScrollOffset))
|
||||
animationsAllowed = true
|
||||
return false
|
||||
}
|
||||
})
|
||||
@@ -2638,7 +2641,7 @@ class ConversationFragment :
|
||||
|
||||
val snapshot = ConversationItemSelection.snapshotView(target, binding.conversationItemRecycler, messageRecord, videoBitmap)
|
||||
|
||||
val focusedView = if (container.isInputShowing) null else itemView.rootView.findFocus()
|
||||
val focusedView = if (container.isInputShowing || !container.isKeyboardShowing) null else itemView.rootView.findFocus()
|
||||
val bodyBubble = target.bubbleView
|
||||
val selectedConversationModel = SelectedConversationModel(
|
||||
snapshot,
|
||||
|
||||
Reference in New Issue
Block a user