mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
more updates to back progress animation
This commit is contained in:
parent
562242e498
commit
572ae2d398
3 changed files with 10 additions and 6 deletions
|
@ -278,8 +278,9 @@ open class MainActivity : BaseActivity<MainActivityBinding>() {
|
|||
)
|
||||
velocityTracker.addMovement(motionEvent)
|
||||
motionEvent.recycle()
|
||||
velocityTracker.computeCurrentVelocity(2, 5f)
|
||||
backVelocity = max(1f, abs(velocityTracker.getAxisVelocity(MotionEvent.AXIS_X)))
|
||||
velocityTracker.computeCurrentVelocity(1, 5f)
|
||||
backVelocity =
|
||||
max(0.5f, abs(velocityTracker.getAxisVelocity(MotionEvent.AXIS_X)) * 0.5f)
|
||||
}
|
||||
lastX = 0f
|
||||
lastY = 0f
|
||||
|
|
|
@ -42,6 +42,7 @@ import eu.kanade.tachiyomi.util.system.powerManager
|
|||
import eu.kanade.tachiyomi.util.system.rootWindowInsetsCompat
|
||||
import eu.kanade.tachiyomi.util.view.animateBlur
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
|
@ -285,8 +286,10 @@ class FullCoverDialog(val controller: MangaDetailsController, drawable: Drawable
|
|||
transitionSet.addTransition(ChangeImageTransform())
|
||||
transitionSet.duration = shortAnimationDuration
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
velocityTracker.computeCurrentVelocity(2, 40f)
|
||||
transitionSet.interpolator = DecelerateInterpolator(max(1f, velocityTracker.getAxisVelocity(MotionEvent.AXIS_X)))
|
||||
velocityTracker.computeCurrentVelocity(1, 5f)
|
||||
val velo =
|
||||
max(0.5f, abs(velocityTracker.getAxisVelocity(MotionEvent.AXIS_X)) * 0.5f)
|
||||
transitionSet.interpolator = DecelerateInterpolator(velo)
|
||||
}
|
||||
TransitionManager.beginDelayedTransition(binding.root, transitionSet)
|
||||
|
||||
|
|
|
@ -812,14 +812,14 @@ fun Controller.withFadeTransaction(): RouterTransaction {
|
|||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||
FadeChangeHandler()
|
||||
} else {
|
||||
CrossFadeChangeHandler(removesFromViewOnPush = isLowRam)
|
||||
CrossFadeChangeHandler(isLowRam)
|
||||
},
|
||||
)
|
||||
.popChangeHandler(
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||
FadeChangeHandler()
|
||||
} else {
|
||||
CrossFadeChangeHandler(removesFromViewOnPush = isLowRam)
|
||||
CrossFadeChangeHandler(isLowRam)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue