Use position in window for volume touchable insets.

For a currently unknown reason (this bug began yesterday, but volume files have not changed in over a week), the touchable insets are shifted ~550px to the left, which means you can't interact with the volume panel.

Bug: 184485868
Test: manual
Change-Id: I88674a64f1f686c1f09e737bf623de7875e799c1
This commit is contained in:
Josh Tsuji
2021-04-05 16:17:29 -04:00
parent 8d2848bbab
commit 5b10f7158c

View File

@@ -301,11 +301,13 @@ public class VolumeDialogImpl implements VolumeDialog,
// the volume dialog container itself, so this is fine.
for (int i = 0; i < mDialogView.getChildCount(); i++) {
final View view = mDialogView.getChildAt(i);
final int[] locInWindow = new int[2];
view.getLocationInWindow(locInWindow);
mTouchableRegion.op(
view.getLeft(),
view.getTop(),
view.getRight(),
view.getBottom(),
locInWindow[0],
locInWindow[1],
locInWindow[0] + view.getWidth(),
locInWindow[1] + view.getHeight(),
Region.Op.UNION);
}