Commit a03d269c authored by Stephane Zermatten's avatar Stephane Zermatten Committed by Commit Bot

[Autofill Assistant] Fix bug that prevented access to controls.

Before this change, the tab controls were not accessible while the
overlay was enabled. This is because the touch event filter covers the
whole screen, even though only a part of the screen is grayed out. The
controls were only accessible while an area of the screen was touchable.

With this change, the tab controls are always accessible, no matter the
state of the touch event filter.

Bug: 806868
Change-Id: Ia3e2e8b3c78758f92027afb73cebe4d703bbfb1c
Reviewed-on: https://chromium-review.googlesource.com/c/1350951Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610865}
parent 2788395c
......@@ -250,6 +250,11 @@ public class TouchEventFilter
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
if (event.getY() < getVisualViewportTop() || event.getY() > getVisualViewportBottom()) {
// The event is meant for the top or bottom bar. Let it through.
return false;
}
// Note that partial overlays have precedence over full overlays
if (mPartialOverlayEnabled) return dispatchTouchEventWithPartialOverlay(event);
if (mFullOverlayEnabled) return dispatchTouchEventWithFullOverlay(event);
......@@ -276,15 +281,12 @@ public class TouchEventFilter
// to avoid interrupting that scroll.
return false;
}
// fallthrough
// fall through
case MotionEvent.ACTION_DOWN:
// Only let through events if they're meant for the touchable area of the screen.
int yTop = getVisualViewportTop();
int yBottom = getVisualViewportBottom();
if (event.getY() < yTop || event.getY() > yBottom) {
return false; // Let it through. It's meant for the controls.
}
int height = yBottom - yTop;
boolean allowed = isInTouchableArea(((float) event.getX()) / getWidth(),
(((float) event.getY() - yTop + mBrowserScrollOffsetY + mOffsetY)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment