From c55758d71683d470949b5f9419a46dc85f6653bf Mon Sep 17 00:00:00 2001 From: Aleksandr Chatsky Date: Fri, 13 Dec 2024 14:26:29 +0200 Subject: [PATCH] Fix jumpy animation of chat input on keyboard show/hide MOB-3860 --- .../src/main/java/com/glia/widgets/chat/ChatView.kt | 9 ++++++++- widgetssdk/src/main/res/layout/chat_view.xml | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/widgetssdk/src/main/java/com/glia/widgets/chat/ChatView.kt b/widgetssdk/src/main/java/com/glia/widgets/chat/ChatView.kt index 712082901..4f8b50fc5 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/chat/ChatView.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/chat/ChatView.kt @@ -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 @@ -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) diff --git a/widgetssdk/src/main/res/layout/chat_view.xml b/widgetssdk/src/main/res/layout/chat_view.xml index 848c1c921..3d7c3c58f 100644 --- a/widgetssdk/src/main/res/layout/chat_view.xml +++ b/widgetssdk/src/main/res/layout/chat_view.xml @@ -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"/> @@ -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" @@ -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"