Slight polish for split screen gesture animation

* Divider bar dimensions manually calculated since
the leash that is provided has bounds larger than
the space that is visually shown between the two split
apps

Bug: 181704764
Test: Swipe up on large and normal screen,
w/ and w/o home rotation enabled

Change-Id: I1fde053151d47c6ce3e11f16f8ae4a153d273871
This commit is contained in:
Vinit Nayak
2021-09-07 16:50:21 -07:00
parent 9d4966d0ca
commit d1a70eeb75
4 changed files with 31 additions and 27 deletions

View File

@@ -88,25 +88,29 @@ public final class SplitConfigurationOptions {
public static class StagedSplitBounds {
public final Rect leftTopBounds;
public final Rect rightBottomBounds;
public final Rect dividerBounds;
/** This rect represents the actual gap between the two apps */
public final Rect visualDividerBounds;
// This class is orientation-agnostic, so we compute both for later use
public final float topTaskPercent;
public final float leftTaskPercent;
public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds, Rect dividerBounds) {
public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds) {
this.leftTopBounds = leftTopBounds;
this.rightBottomBounds = rightBottomBounds;
this.dividerBounds = dividerBounds;
float totalHeight = this.leftTopBounds.height()
+ this.rightBottomBounds.height()
+ this.dividerBounds.height();
float totalWidth = this.leftTopBounds.width()
+ this.rightBottomBounds.width()
+ this.dividerBounds.width();
leftTaskPercent = this.leftTopBounds.width() / totalWidth;
topTaskPercent = this.leftTopBounds.height() / totalHeight;
if (rightBottomBounds.top > leftTopBounds.top) {
// vertical apps, horizontal divider
this.visualDividerBounds = new Rect(leftTopBounds.left, leftTopBounds.bottom,
leftTopBounds.right, rightBottomBounds.top);
} else {
// horizontal apps, vertical divider
this.visualDividerBounds = new Rect(leftTopBounds.right, leftTopBounds.top,
rightBottomBounds.left, leftTopBounds.bottom);
}
leftTaskPercent = this.leftTopBounds.width() / (float) rightBottomBounds.right;
topTaskPercent = this.leftTopBounds.height() / (float) rightBottomBounds.bottom;
}
}