am 21116068: Merge "Ignore generic motion events if custom content doesn\'t allow scrolling" into ub-now-porkchop

* commit '2111606845bec8b40e8eb164c73c60f59c028014':
  Ignore generic motion events if custom content doesn't allow scrolling
This commit is contained in:
Jan-Willem Maarse
2014-08-20 20:35:57 +00:00
committed by Android Git Automerger
+11
View File
@@ -1115,6 +1115,17 @@ public class Workspace extends SmoothPagedView
return super.onInterceptTouchEvent(ev);
}
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
// Ignore pointer scroll events if the custom content doesn't allow scrolling.
if ((getScreenIdForPageIndex(getCurrentPage()) == CUSTOM_CONTENT_SCREEN_ID)
&& (mCustomContentCallbacks != null)
&& !mCustomContentCallbacks.isScrollingAllowed()) {
return false;
}
return super.onGenericMotionEvent(event);
}
protected void reinflateWidgetsIfNecessary() {
final int clCount = getChildCount();
for (int i = 0; i < clCount; i++) {