From a091f4ff4c8dbfc303fbd3459c6130c010085e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Tue, 26 Sep 2023 10:39:50 +0200 Subject: [PATCH] Ensure HomeScreenGrid steals touches from widgets when folder is open This closes #147 --- .../simplemobiletools/launcher/views/HomeScreenGrid.kt | 9 +++++++++ 1 file changed, 9 insertions(+) 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 c038c8b..6e73634 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -20,6 +20,7 @@ import android.text.TextUtils import android.util.AttributeSet import android.util.Size import android.util.SizeF +import android.view.MotionEvent import android.view.View import android.view.animation.DecelerateInterpolator import android.view.animation.OvershootInterpolator @@ -1511,6 +1512,14 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel } } + override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean { + return if (currentlyOpenFolder != null) { + true + } else { + super.onInterceptTouchEvent(ev) + } + } + private fun Canvas.drawItemInCell(item: HomeScreenGridItem, cell: Rect) { if (item.id != draggedItem?.id) { val drawableX = cell.left + iconMargin