Remaining input bar animation

This commit is contained in:
Niels Andriesse 2021-06-18 09:51:44 +10:00
parent f4621a4fee
commit a5bf1a3c66
2 changed files with 7 additions and 1 deletions

View File

@ -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
}

View File

@ -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)