Skip to content

Commit

Permalink
Fix jumpy animation of chat input on keyboard show/hide
Browse files Browse the repository at this point in the history
MOB-3860
  • Loading branch information
gugalo committed Dec 13, 2024
1 parent 71de68b commit c55758d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion widgetssdk/src/main/java/com/glia/widgets/chat/ChatView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
import androidx.transition.AutoTransition
import androidx.transition.ChangeBounds
import androidx.transition.ChangeTransform
import androidx.transition.Fade
Expand Down Expand Up @@ -885,7 +886,13 @@ internal class ChatView(context: Context, attrs: AttributeSet?, defStyleAttr: In
}

private fun updateSecureMessagingState(state: ChatState) {
TransitionManager.beginDelayedTransition(rootConstraintLayout)
TransitionManager.beginDelayedTransition(rootConstraintLayout, AutoTransition()
.addTarget(binding.scErrorLabel)
.addTarget(binding.scTopBannerTitle)
.addTarget(binding.scTopBannerIcon)
.addTarget(binding.scTopBannerBackground)
.addTarget(binding.scTopBannerDivider)
)
binding.scErrorLabel.isVisible = state.isSecureConversationsUnavailableLabelVisible
if (state.isSecureConversationsTopBannerVisible.not() && isNeedSupportDropDownShown()) {
onNeedSupportButtonClicked(null)
Expand Down
10 changes: 5 additions & 5 deletions widgetssdk/src/main/res/layout/chat_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
android:layout_height="0dp"
android:layout_width="0dp"
app:layout_constraintTop_toTopOf="@+id/chat_edit_text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/chat_edit_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

Expand All @@ -246,8 +246,8 @@
android:id="@+id/add_attachment_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@+id/message_input_background"
app:layout_constraintBottom_toBottomOf="@+id/message_input_background"
app:layout_constraintTop_toTopOf="@+id/chat_edit_text"
app:layout_constraintBottom_toBottomOf="@+id/chat_edit_text"
app:layout_constraintStart_toEndOf="@+id/chat_edit_text"
app:layout_constraintEnd_toStartOf="@+id/send_button"
app:tint="@color/input_normal_color_state_list"
Expand All @@ -260,8 +260,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/glia_large"
app:layout_constraintBottom_toBottomOf="@+id/message_input_background"
app:layout_constraintTop_toTopOf="@+id/message_input_background"
app:layout_constraintBottom_toBottomOf="@+id/chat_edit_text"
app:layout_constraintTop_toTopOf="@+id/chat_edit_text"
app:layout_constraintStart_toEndOf="@+id/add_attachment_button"
app:layout_constraintEnd_toEndOf="parent"
android:background="?attr/selectableItemBackground"
Expand Down

0 comments on commit c55758d

Please sign in to comment.