Merge pull request #137 from esensar/fix/133-widgets-flicker

Prevent widgets flicker by skipping the last update in animation
This commit is contained in:
Tibor Kaputa 2023-09-21 11:14:10 +02:00 committed by GitHub
commit 24f3132641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

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