mirror of
				https://github.com/SimpleMobileTools/Simple-Launcher.git
				synced 2025-06-05 21:59:15 +02:00 
			
		
		
		
	Reduce delay for page changes
This commit is contained in:
		| @@ -1039,7 +1039,6 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel | |||||||
|         if (redraw) { |         if (redraw) { | ||||||
|             redrawGrid() |             redrawGrid() | ||||||
|         } |         } | ||||||
|         postDelayed({ pageChangeEnabled = true }, PAGE_CHANGE_BLOCKING_DURATION) |  | ||||||
|         ValueAnimator.ofFloat(1f, 0f) |         ValueAnimator.ofFloat(1f, 0f) | ||||||
|             .apply { |             .apply { | ||||||
|                 addUpdateListener { |                 addUpdateListener { | ||||||
| @@ -1050,6 +1049,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel | |||||||
|                     override fun onAnimationEnd(animation: Animator) { |                     override fun onAnimationEnd(animation: Animator) { | ||||||
|                         super.onAnimationEnd(animation) |                         super.onAnimationEnd(animation) | ||||||
|                         pageChangeAnimLeftPercentage = 0f |                         pageChangeAnimLeftPercentage = 0f | ||||||
|  |                         pageChangeEnabled = true | ||||||
|                         lastPage = currentPage |                         lastPage = currentPage | ||||||
|                         redrawGrid() |                         redrawGrid() | ||||||
|                     } |                     } | ||||||
| @@ -1059,8 +1059,6 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     companion object { |     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 const val PAGE_CHANGE_HOLD_THRESHOLD = 500L | ||||||
|  |  | ||||||
|         private enum class PageChangeArea { |         private enum class PageChangeArea { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user