Let host view handle long-press when using drag-to-open

BUG: 18605860
Change-Id: I75850138614f17cf728d4411c142a07bdf15d085
This commit is contained in:
Alan Viverette
2014-12-03 15:24:31 -08:00
parent 2ea3650d18
commit 298536b1a0

View File

@@ -1385,7 +1385,9 @@ public class ListPopupWindow {
clearCallbacks();
final View src = mSrc;
if (!src.isEnabled()) {
if (!src.isEnabled() || src.isLongClickable()) {
// Ignore long-press if the view is disabled or has its own
// handler.
return;
}
@@ -1394,12 +1396,12 @@ public class ListPopupWindow {
}
// Don't let the parent intercept our events.
mSrc.getParent().requestDisallowInterceptTouchEvent(true);
src.getParent().requestDisallowInterceptTouchEvent(true);
// Make sure we cancel any ongoing source event stream.
final long now = SystemClock.uptimeMillis();
final MotionEvent e = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0, 0, 0);
mSrc.onTouchEvent(e);
src.onTouchEvent(e);
e.recycle();
mForwarding = true;