Fixing longpress bug on widgets with a ListView

Change-Id: Idca7a8948ca21f1e7a1c332fd56303f903eb122d
This commit is contained in:
Adam Cohen
2010-08-04 18:53:34 -07:00
parent d4ede5325b
commit ec1b932159
+14
View File
@@ -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();