mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Trying to round NaN
This commit is contained in:
parent
902b6f6486
commit
2c76508c92
1 changed files with 8 additions and 4 deletions
|
@ -86,10 +86,14 @@ class CrossFadeChangeHandler : AnimatorChangeHandler {
|
||||||
animatorSet.duration = if (isPush) {
|
animatorSet.duration = if (isPush) {
|
||||||
200
|
200
|
||||||
} else {
|
} else {
|
||||||
from?.let {
|
try {
|
||||||
val startX = from.width.toFloat() * 0.2f
|
from?.let {
|
||||||
((startX - it.x) / startX) * 150f
|
val startX = from.width.toFloat() * 0.2f
|
||||||
}?.roundToLong() ?: 150
|
((startX - it.x) / startX) * 150f
|
||||||
|
}?.roundToLong()
|
||||||
|
} catch (e: IllegalArgumentException) {
|
||||||
|
null
|
||||||
|
} ?: 150
|
||||||
}
|
}
|
||||||
animatorSet.doOnCancel { to?.x = 0f }
|
animatorSet.doOnCancel { to?.x = 0f }
|
||||||
animatorSet.doOnEnd { to?.x = 0f }
|
animatorSet.doOnEnd { to?.x = 0f }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue