Account for OHM offset before possibly hiding the PIP menu

Menu actions were not clickable because the drag corner resize
handler did not take into account the OHM offset when comparing
the touch location to the PIP bounds, wrongly causing the menu
to be hidden on ACTION_DOWN and thus the menu actions never got
their click listeners fired on ACTION_UP.

Bug: 172839150
Test: Enter PIP with YT, enter OHM, play/pause/expand work fine
Change-Id: I8d1539cef46a5d7c0afe88e80638175cb3994db3
This commit is contained in:
jorgegil@google.com
2021-03-31 11:39:42 -07:00
parent b5cc4a537b
commit 1965456d5b

View File

@@ -441,7 +441,7 @@ public class PipResizeGestureHandler {
mDownPoint.set(x, y);
mDownBounds.set(mPipBoundsState.getBounds());
}
if (!currentPipBounds.contains((int) ev.getX(), (int) ev.getY())
if (!currentPipBounds.contains((int) x, (int) y)
&& mPhonePipMenuController.isMenuVisible()) {
mPhonePipMenuController.hideMenu();
}