From 1b0dc44ca856d9091a3b8f76ea26f28a201d6652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 20 Jul 2023 13:35:22 +0200 Subject: [PATCH] Reduce delay for page changes --- .../com/simplemobiletools/launcher/views/HomeScreenGrid.kt | 4 +--- 1 file changed, 1 insertion(+), 3 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 7a425c2..90fdd78 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -1039,7 +1039,6 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel if (redraw) { redrawGrid() } - postDelayed({ pageChangeEnabled = true }, PAGE_CHANGE_BLOCKING_DURATION) ValueAnimator.ofFloat(1f, 0f) .apply { addUpdateListener { @@ -1050,6 +1049,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel override fun onAnimationEnd(animation: Animator) { super.onAnimationEnd(animation) pageChangeAnimLeftPercentage = 0f + pageChangeEnabled = true lastPage = currentPage redrawGrid() } @@ -1059,8 +1059,6 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel } companion object { - private const val ANIMATION_DURATION = 700L - private const val PAGE_CHANGE_BLOCKING_DURATION = ANIMATION_DURATION private const val PAGE_CHANGE_HOLD_THRESHOLD = 500L private enum class PageChangeArea {