Fix issue with camera overlapping split staging UI

Fixes an issue on some devices where initiating a split in Overview would cause an icon to be placed partly under the camera cutout.

Fixed by adding some padding to FloatingTaskView#mSplitPlaceHolderView, so that it always respects the device's insets.

Fixes: 220997064
Test: Manual
Change-Id: I7270bde3320f562519ea8e36a38e49609e0d6cd7
This commit is contained in:
Jeremy Sim
2022-03-21 19:55:07 -07:00
parent da297fb0f1
commit b8eeb41ee0
5 changed files with 90 additions and 17 deletions

View File

@@ -399,7 +399,8 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
// In fake land/seascape, the placeholder always needs to go to the "top" of the device,
// which is the same bounds as 0 rotation.
int width = dp.widthPx;
out.set(0, 0, width, placeholderHeight);
int insetThickness = dp.getInsets().top;
out.set(0, 0, width, placeholderHeight + insetThickness);
out.inset(placeholderInset, 0);
// Adjust the top to account for content off screen. This will help to animate the view in
@@ -411,6 +412,19 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
out.top -= (totalHeight - placeholderHeight);
}
@Override
public void updateStagedSplitIconParams(FrameLayout.LayoutParams out, float onScreenRectCenterX,
float onScreenRectCenterY, float fullscreenScaleX, float fullscreenScaleY,
int drawableWidth, int drawableHeight, DeviceProfile dp,
@StagePosition int stagePosition) {
float inset = dp.getInsets().top;
out.leftMargin = Math.round(onScreenRectCenterX / fullscreenScaleX
- 1.0f * drawableWidth / 2);
out.topMargin = Math.round((onScreenRectCenterY + (inset / 2f)) / fullscreenScaleY
- 1.0f * drawableHeight / 2);
}
@Override
public void getFinalSplitPlaceholderBounds(int splitDividerSize, DeviceProfile dp,
@StagePosition int stagePosition, Rect out1, Rect out2) {