Set GroupedTaskView child thumbnails in onMeasure

* Also add indicator if split was originally started
in portrait of landscape, so we know which dimension
of the divider bar to use if user goes to overview
and then rotates device (horizontal divider vs
vertical)

Fixes: 199461137
Test: Swipe to overview with staged split
Rotate device with and without live tile
Doesn't overlap with overview actions

Change-Id: I8b7f104f16d5b7265828f1b3d98ba3426b28d44f
This commit is contained in:
Vinit Nayak
2021-09-13 18:00:52 -07:00
parent 2d9741b832
commit e6abfca7ab
5 changed files with 82 additions and 51 deletions

View File

@@ -93,7 +93,13 @@ public final class SplitConfigurationOptions {
// This class is orientation-agnostic, so we compute both for later use
public final float topTaskPercent;
public final float leftTaskPercent;
/**
* If {@code true}, that means at the time of creation of this object, the
* split-screened apps were vertically stacked. This is useful in scenarios like
* rotation where the bounds won't change, but this variable can indicate what orientation
* the bounds were originally in
*/
public final boolean appsStackedVertically;
public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds) {
this.leftTopBounds = leftTopBounds;
@@ -103,10 +109,12 @@ public final class SplitConfigurationOptions {
// vertical apps, horizontal divider
this.visualDividerBounds = new Rect(leftTopBounds.left, leftTopBounds.bottom,
leftTopBounds.right, rightBottomBounds.top);
appsStackedVertically = true;
} else {
// horizontal apps, vertical divider
this.visualDividerBounds = new Rect(leftTopBounds.right, leftTopBounds.top,
rightBottomBounds.left, leftTopBounds.bottom);
appsStackedVertically = false;
}
leftTaskPercent = this.leftTopBounds.width() / (float) rightBottomBounds.right;