/**
   * This is called with the full window width and height to allow stack view children to perform
   * the full screen transition down.
   */
  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int width = MeasureSpec.getSize(widthMeasureSpec);
    int height = MeasureSpec.getSize(heightMeasureSpec);

    // Compute our stack/task rects
    Rect taskStackBounds = new Rect(mTaskStackBounds);
    taskStackBounds.bottom -= mConfig.systemInsets.bottom;
    computeRects(
        width, height, taskStackBounds, mConfig.launchedWithAltTab, mConfig.launchedFromHome);

    // If this is the first layout, then scroll to the front of the stack and synchronize the
    // stack views immediately to load all the views
    if (mAwaitingFirstLayout) {
      mStackScroller.setStackScrollToInitialState();
      requestSynchronizeStackViewsWithModel();
      synchronizeStackViewsWithModel();
    }

    // Measure each of the TaskViews
    int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
      TaskView tv = (TaskView) getChildAt(i);
      if (tv.isFullScreenView()) {
        tv.measure(widthMeasureSpec, heightMeasureSpec);
      } else {
        if (tv.getBackground() != null) {
          tv.getBackground().getPadding(mTmpRect);
        } else {
          mTmpRect.setEmpty();
        }
        tv.measure(
            MeasureSpec.makeMeasureSpec(
                mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,
                MeasureSpec.EXACTLY),
            MeasureSpec.makeMeasureSpec(
                mLayoutAlgorithm.mTaskRect.height()
                    + mTmpRect.top
                    + mTmpRect.bottom
                    + tv.getMaxFooterHeight(),
                MeasureSpec.EXACTLY));
      }
    }

    setMeasuredDimension(width, height);
  }