From 887cce5e67b26add52229473da66f5c4921414c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 21 Sep 2023 11:04:40 +0200 Subject: [PATCH] Prevent widgets flicker by skipping the last update in animation This closes #133 --- .../com/simplemobiletools/launcher/views/HomeScreenGrid.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt index 6ef0e08..57e3812 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -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) {