Place TaskMenuView aligned with secondary split thumbnail

* Use consistent divider calculations in
different methods

Fixes: 245610772
Fixes: 218784487

Test: Open task menu view in split pair in landscape/
seascape/portrait, real and fake.

Change-Id: If1bbc7a0d4f1767584d0fc8cf549130f35b8e4a3
This commit is contained in:
Vinit Nayak
2022-09-09 11:25:08 -07:00
parent cd8541495a
commit 2e4dcb16a7
5 changed files with 60 additions and 21 deletions

View File

@@ -376,6 +376,19 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
return isRtl ? 1 : -1;
}
@Override
public void setSecondaryTaskMenuPosition(SplitBounds splitBounds, View taskView,
DeviceProfile deviceProfile, View primarySnaphotView, View taskMenuView) {
float topLeftTaskPlusDividerPercent = splitBounds.appsStackedVertically
? (splitBounds.topTaskPercent + splitBounds.dividerHeightPercent)
: (splitBounds.leftTaskPercent + splitBounds.dividerWidthPercent);
FrameLayout.LayoutParams snapshotParams =
(FrameLayout.LayoutParams) primarySnaphotView.getLayoutParams();
float additionalOffset = (taskView.getHeight() - snapshotParams.topMargin)
* topLeftTaskPlusDividerPercent;
taskMenuView.setY(taskMenuView.getY() + additionalOffset);
}
/* -------------------- */
@Override
@@ -492,8 +505,8 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx;
int totalThumbnailHeight = parentHeight - spaceAboveSnapshot;
int dividerBar = splitBoundsConfig.appsStackedVertically
? splitBoundsConfig.visualDividerBounds.height()
: splitBoundsConfig.visualDividerBounds.width();
? (int) (splitBoundsConfig.dividerHeightPercent * parentHeight)
: (int) (splitBoundsConfig.dividerWidthPercent * parentWidth);
int primarySnapshotHeight;
int primarySnapshotWidth;
int secondarySnapshotHeight;