mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user