From 974275a42993534b6d63ae6ba34b75c3c21b7627 Mon Sep 17 00:00:00 2001 From: Antoine Gaudreau Simard Date: Sun, 23 May 2021 11:00:43 -0400 Subject: [PATCH] Prevent view from being removed if a to is found (#5135) (#5152) Introduced in c68e7c8da78309a0b091c11379a8da5c6222572d --- .../ui/base/controller/OneWayFadeChangeHandler.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/OneWayFadeChangeHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/OneWayFadeChangeHandler.kt index 8d6cb3312..e5357caaa 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/OneWayFadeChangeHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/OneWayFadeChangeHandler.kt @@ -31,11 +31,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 }