Mouse wheel scroll apps with work profile enabled instead of switching tabs

Test: Manual
Bug:79164903
Change-Id: I4b382034ea5b91b24dcc158bd9fa46d64f54cc7a
This commit is contained in:
Samuel Fufa committed 2019-08-23 11:20:29 -07:00
1 parent 6fe3eec95c
commit 59cba191c3
2 files changed
+12

No files matched your search

+7
View File
@@ -1299,6 +1299,9 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
vscroll = -event.getAxisValue(MotionEvent.AXIS_VSCROLL);
hscroll = event.getAxisValue(MotionEvent.AXIS_HSCROLL);
}
if (Math.abs(vscroll) > Math.abs(hscroll) && !isVerticalScrollable()) {
return true;
}
if (hscroll != 0 || vscroll != 0) {
boolean isForwardScroll = mIsRtl ? (hscroll < 0 || vscroll < 0)
: (hscroll > 0 || vscroll > 0);
@@ -1315,6 +1318,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
return super.onGenericMotionEvent(event);
}
protected boolean isVerticalScrollable() {
return true;
}
private void acquireVelocityTrackerAndAddMovement(MotionEvent ev) {
if (mVelocityTracker == null) {
mVelocityTracker = VelocityTracker.obtain();