Fix animation glitch

pull/619/head
Niels Andriesse 3 years ago
parent e61c3288fa
commit bf24b84840

@ -169,10 +169,10 @@ class VisibleMessageView : LinearLayout {
swipeToReplyIconRect.bottom = height - bottomVOffset swipeToReplyIconRect.bottom = height - bottomVOffset
swipeToReplyIcon.bounds = swipeToReplyIconRect swipeToReplyIcon.bounds = swipeToReplyIconRect
swipeToReplyIcon.alpha = (255.0f * (min(abs(translationX), threshold) / threshold)).roundToInt() swipeToReplyIcon.alpha = (255.0f * (min(abs(translationX), threshold) / threshold)).roundToInt()
swipeToReplyIcon.draw(canvas)
} else { } else {
swipeToReplyIcon.alpha = 0 swipeToReplyIcon.alpha = 0
} }
swipeToReplyIcon.draw(canvas)
super.onDraw(canvas) super.onDraw(canvas)
} }
@ -234,6 +234,7 @@ class VisibleMessageView : LinearLayout {
animate() animate()
.translationX(0.0f) .translationX(0.0f)
.setDuration(150) .setDuration(150)
.setUpdateListener { postInvalidate() } // Ensure onDraw(canvas:) is called
.start() .start()
} }

Loading…
Cancel
Save