Bundle data = msg.getData();
Rect windowRect = (Rect) data.getParcelable("windowRect");
Rect systemInsets = (Rect) data.getParcelable("systemInsets");
- RecentsConfiguration.getInstance().updateSystemInsets(systemInsets);
// Create a dummy task stack & compute the rect for the thumbnail to animate to
TaskStack stack = new TaskStack(context);
TaskStackView tsv = new TaskStackView(context, stack);
- tsv.computeRects(windowRect.width(), windowRect.height() - systemInsets.top);
+ // Since the nav bar height is already accounted for in the windowRect, don't pass
+ // in a bottom inset
+ tsv.computeRects(windowRect.width(), windowRect.height() - systemInsets.top, 0);
tsv.boundScroll();
TaskViewTransform transform = tsv.getStackTransform(0);
Rect taskRect = new Rect(transform.rect);
}
/** Computes the stack and task rects */
- public void computeRects(int width, int height) {
+ public void computeRects(int width, int height, int insetBottom) {
// Note: We let the stack view be the full height because we want the cards to go under the
// navigation bar if possible. However, the stack rects which we use to calculate
// max scroll, etc. need to take the nav bar into account
// Compute the stack rects
- RecentsConfiguration config = RecentsConfiguration.getInstance();
mRect.set(0, 0, width, height);
mStackRect.set(mRect);
- mStackRect.bottom -= config.systemInsets.bottom;
+ mStackRect.bottom -= insetBottom;
int smallestDimension = Math.min(width, height);
int padding = (int) (Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
" awaitingFirstLayout: " + mAwaitingFirstLayout, Console.AnsiGreen);
// Compute our stack/task rects
- computeRects(width, height);
+ RecentsConfiguration config = RecentsConfiguration.getInstance();
+ computeRects(width, height, config.systemInsets.bottom);
// Debug logging
if (Constants.DebugFlags.UI.MeasureAndLayout) {