Prevent widgets flicker by skipping the last update in animation

This closes #133
This commit is contained in:
Ensar Sarajčić 2023-09-21 11:04:40 +02:00
parent 6e9d8686bf
commit 887cce5e67
1 changed files with 4 additions and 2 deletions

View File

@ -1931,8 +1931,10 @@ private class AnimatedGridPager(
.apply {
interpolator = OvershootInterpolator(1f)
addUpdateListener {
pageChangeAnimLeftPercentage = it.animatedValue as Float
redrawGrid()
if (it.animatedValue != 0f) {
pageChangeAnimLeftPercentage = it.animatedValue as Float
redrawGrid()
}
}
addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {