From a5bf1a3c6613ad1adcaa9318ce23b77acba2ae44 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Fri, 18 Jun 2021 09:51:44 +1000 Subject: [PATCH] Remaining input bar animation --- .../securesms/conversation/v2/ConversationActivityV2.kt | 5 ++++- .../conversation/v2/input_bar/InputBarRecordingView.kt | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 27da38acd5..8adb21a0da 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -159,11 +159,13 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe override fun toggleAttachmentOptions() { val targetAlpha = if (isShowingAttachmentOptions) 0.0f else 1.0f val allButtons = listOf( cameraButtonContainer, libraryButtonContainer, documentButtonContainer, gifButtonContainer) + val isReversed = isShowingAttachmentOptions // Run the animation in reverse + val count = allButtons.size allButtons.indices.forEach { index -> val view = allButtons[index] val animation = ValueAnimator.ofObject(FloatEvaluator(), view.alpha, targetAlpha) animation.duration = 250L - animation.startDelay = 50L * index.toLong() + animation.startDelay = if (isReversed) 50L * (count - index.toLong()) else 50L * index.toLong() animation.addUpdateListener { animator -> view.alpha = animator.animatedValue as Float } @@ -321,6 +323,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } animation.start() } + inputBarRecordingView.hide() } // endregion } \ No newline at end of file diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/input_bar/InputBarRecordingView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/input_bar/InputBarRecordingView.kt index 62a8b2f794..66fc65446e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/input_bar/InputBarRecordingView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/input_bar/InputBarRecordingView.kt @@ -41,6 +41,9 @@ class InputBarRecordingView : RelativeLayout { fun show() { startTimestamp = Date().time recordButtonOverlayImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_microphone, context.theme)) + inputBarCancelButton.alpha = 0.0f + inputBarMiddleContentContainer.alpha = 1.0f + lockView.alpha = 1.0f isVisible = true alpha = 0.0f val animation = ValueAnimator.ofObject(FloatEvaluator(), 0.0f, 1.0f)