From 5438207fba61fdf330a70fda1d30aadb8e3db34a Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 18 Jul 2019 12:01:23 +0200 Subject: [PATCH] faster animation for quick reply --- .../riotx/features/home/room/detail/RoomDetailFragment.kt | 5 ++--- .../features/home/room/detail/composer/TextComposerView.kt | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index 55ee4dfa..aeb3f05f 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -269,9 +269,8 @@ class RoomDetailFragment : ?: "", event.senderName, composerLayout.composerRelatedMessageAvatar) composerLayout.composerEditText.setSelection(composerLayout.composerEditText.text.length) - composerLayout.expand { - focusComposerAndShowKeyboard() - } + composerLayout.expand() + focusComposerAndShowKeyboard() } override fun onResume() { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt index 488ecbd3..4a3fc3ff 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt @@ -57,6 +57,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib var currentConstraintSetId: Int = -1 + private val animationDuration = 100L init { inflate(context, R.layout.merge_composer_layout, this) @@ -73,7 +74,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib currentConstraintSetId = R.layout.constraint_set_composer_layout_compact if (animate) { val transition = AutoTransition() -// transition.duration = 5000 + transition.duration = animationDuration transition.addListener(object : Transition.TransitionListener { override fun onTransitionEnd(transition: Transition) { @@ -105,7 +106,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib currentConstraintSetId = R.layout.constraint_set_composer_layout_expanded if (animate) { val transition = AutoTransition() -// transition.duration = 5000 + transition.duration = animationDuration transition.addListener(object : Transition.TransitionListener { override fun onTransitionEnd(transition: Transition) {