Merge "Ensure we account for insets in minimized state."

This commit is contained in:
TreeHugger Robot
2017-01-19 19:04:34 +00:00
committed by Android (Google) Code Review
4 changed files with 19 additions and 9 deletions

View File

@@ -128,11 +128,14 @@ public class PipSnapAlgorithm {
/**
* Applies the offset to the {@param stackBounds} to adjust it to a minimized state.
*/
public void applyMinimizedOffset(Rect stackBounds, Rect movementBounds, Point displaySize) {
public void applyMinimizedOffset(Rect stackBounds, Rect movementBounds, Point displaySize,
Rect stableInsets) {
if (stackBounds.left <= movementBounds.centerX()) {
stackBounds.offsetTo(-stackBounds.width() + mMinimizedVisibleSize, stackBounds.top);
stackBounds.offsetTo(stableInsets.left + mMinimizedVisibleSize - stackBounds.width(),
stackBounds.top);
} else {
stackBounds.offsetTo(displaySize.x - mMinimizedVisibleSize, stackBounds.top);
stackBounds.offsetTo(displaySize.x - stableInsets.right - mMinimizedVisibleSize,
stackBounds.top);
}
}