From c68e7c8da78309a0b091c11379a8da5c6222572d Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 14 May 2021 10:40:38 -0400 Subject: [PATCH] Update OneWayFadeChangeHandler to match TachiyomiSY Co-authored-by: jobobby04 --- .../ui/base/controller/OneWayFadeChangeHandler.kt | 8 +++++--- 1 file changed, 5 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 b1209e0b4e..8d6cb33120 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 @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.base.controller import android.animation.Animator import android.animation.AnimatorSet +import android.animation.ObjectAnimator import android.view.View import android.view.ViewGroup import com.bluelinelabs.conductor.ControllerChangeHandler @@ -26,15 +27,16 @@ class OneWayFadeChangeHandler : FadeChangeHandler { isPush: Boolean, toAddedToContainer: Boolean ): Animator { + val animator = AnimatorSet() if (to != null) { - return super.getAnimator(container, from, to, isPush, toAddedToContainer) + val start: Float = if (toAddedToContainer) 0F else to.alpha + animator.play(ObjectAnimator.ofFloat(to, View.ALPHA, start, 1f)) } if (from != null && (!isPush || removesFromViewOnPush())) { container.removeView(from) } - - return AnimatorSet() + return animator } override fun copy(): ControllerChangeHandler {