Prevent view from being removed if a to is found (#5135) (#5152)

Introduced in c68e7c8da7

(cherry picked from commit 974275a429)
This commit is contained in:
Antoine Gaudreau Simard
2021-05-23 11:00:43 -04:00
committed by Jobobby04
parent 14de1973a3
commit ac7e2909ba
@@ -26,11 +26,12 @@ class OneWayFadeChangeHandler : FadeChangeHandler {
if (to != null) {
val start: Float = if (toAddedToContainer) 0F else to.alpha
animator.play(ObjectAnimator.ofFloat(to, View.ALPHA, start, 1f))
} else {
if (from != null && (!isPush || removesFromViewOnPush())) {
container.removeView(from)
}
}
if (from != null && (!isPush || removesFromViewOnPush())) {
container.removeView(from)
}
return animator
}