diff --git a/src/com/android/launcher/CellLayout.java b/src/com/android/launcher/CellLayout.java index 157bf56411..160dd18b82 100644 --- a/src/com/android/launcher/CellLayout.java +++ b/src/com/android/launcher/CellLayout.java @@ -98,6 +98,18 @@ public class CellLayout extends ViewGroup { } } + @Override + public void cancelLongPress() { + super.cancelLongPress(); + + // Cancel long press for all children + final int count = getChildCount(); + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + child.cancelLongPress(); + } + } + int getCountX() { return mPortrait ? mShortAxisCells : mLongAxisCells; } diff --git a/src/com/android/launcher/LauncherAppWidgetHostView.java b/src/com/android/launcher/LauncherAppWidgetHostView.java index 1e21a19933..da5b3a02d3 100644 --- a/src/com/android/launcher/LauncherAppWidgetHostView.java +++ b/src/com/android/launcher/LauncherAppWidgetHostView.java @@ -98,4 +98,14 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView { mPendingCheckForLongPress.rememberWindowAttachCount(); postDelayed(mPendingCheckForLongPress, ViewConfiguration.getLongPressTimeout()); } + + @Override + public void cancelLongPress() { + super.cancelLongPress(); + + mHasPerformedLongPress = false; + if (mPendingCheckForLongPress != null) { + removeCallbacks(mPendingCheckForLongPress); + } + } }