From ec1b932159cd6ea5dd5e3aee2554131d175e03d9 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Wed, 4 Aug 2010 18:53:34 -0700 Subject: [PATCH] Fixing longpress bug on widgets with a ListView Change-Id: Idca7a8948ca21f1e7a1c332fd56303f903eb122d --- src/com/android/launcher2/Workspace.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 35a767d9ec..818cedd86b 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -744,6 +744,20 @@ public class Workspace extends ViewGroup return super.dispatchTouchEvent(ev); } + /** + * {@inheritDoc} + */ + @Override + public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) { + if (disallowIntercept) { + // We need to make sure to cancel our long press if + // a scrollable widget takes over touch events + final View currentScreen = getChildAt(mCurrentScreen); + currentScreen.cancelLongPress(); + } + super.requestDisallowInterceptTouchEvent(disallowIntercept); + } + @Override public boolean onInterceptTouchEvent(MotionEvent ev) { final boolean workspaceLocked = mLauncher.isWorkspaceLocked();