mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
Remaining input bar animation
This commit is contained in:
parent
f4621a4fee
commit
a5bf1a3c66
@ -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
|
||||
}
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user