From fc0278f740cde4562bd02cc32411586e137025de Mon Sep 17 00:00:00 2001 From: Bill Lin Date: Thu, 13 May 2021 17:34:22 +0800 Subject: [PATCH] Update divider touch-region with DividerHandle position properly Context : ag/11948950 The divider view itself isn't really relayouted (because now it's surface just gets moved around). This means we actually need to update its touch region when moving the surface instead of in relayout. Additionally, because the views themselves don't move, update the touch-region from divider position instead. What changes: After onLayout() mHandle has the final position on screen, we reference mHandle's left or top position based on orientation and update for corresponding touch-region Test: atest WMShellUnitTests Test: Enable A11y talkback, check the divider handle can be focused Test: add log in notifySplitScreenBoundsChanged() check the split handle touch region dose NOT locate at screen left or top edge Bug: 175687842 Change-Id: I7530e3e1daa373926654c3ae8bc2084566650d62 --- .../com/android/wm/shell/legacysplitscreen/DividerView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java index 60f7ee2941e25..0f16c8ac7cb87 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java @@ -685,9 +685,9 @@ public class DividerView extends FrameLayout implements OnTouchListener, mTmpRect.set(mHandle.getLeft(), mHandle.getTop(), mHandle.getRight(), mHandle.getBottom()); if (isHorizontalDivision()) { - mTmpRect.offsetTo(0, mDividerPositionY); + mTmpRect.offsetTo(mHandle.getLeft(), mDividerPositionY); } else { - mTmpRect.offsetTo(mDividerPositionX, 0); + mTmpRect.offsetTo(mDividerPositionX, mHandle.getTop()); } mWindowManagerProxy.setTouchRegion(mTmpRect);