revert back last CrossFadeChangeHandler change

forgot how ObjectAnimator worked for a bit there
This commit is contained in:
Jays2Kings 2023-10-18 19:28:51 -07:00
parent 3a6e50f169
commit 48b8eae907

View file

@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.base.controller
import android.animation.Animator
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.os.Build
import android.view.View
import android.view.ViewGroup
import com.bluelinelabs.conductor.ControllerChangeHandler
@ -42,12 +41,7 @@ class CrossFadeChangeHandler : AnimatorChangeHandler {
}
} else {
if (from != null) {
val start = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && from.translationX != 0f) {
from.translationX
} else {
from.width.toFloat() * 0.2f
}
animatorSet.play(ObjectAnimator.ofFloat(from, View.TRANSLATION_X, start))
animatorSet.play(ObjectAnimator.ofFloat(from, View.TRANSLATION_X, from.width.toFloat() * 0.2f))
}
if (to != null) {
// Allow this to have a nice transition when coming off an aborted push animation or