Beispiel #1
0
  /** This is called with the full size of the window since we are handling our own insets. */
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    Log.d(TAG, "onLayout: ");
    // Get the search bar bounds so that we lay it out
    if (mSearchBar != null) {
      Rect searchBarSpaceBounds = new Rect();
      mConfig.getSearchBarBounds(
          getMeasuredWidth(), getMeasuredHeight(), mConfig.systemInsets.top, searchBarSpaceBounds);
      mSearchBar.layout(
          searchBarSpaceBounds.left,
          searchBarSpaceBounds.top,
          searchBarSpaceBounds.right,
          searchBarSpaceBounds.bottom);
    }

    // Layout each TaskStackView with the full width and height of the window since the
    // transition view is a child of that stack view
    List<TaskStackView> stackViews = getTaskStackViews();
    int stackCount = stackViews.size();
    for (int i = 0; i < stackCount; i++) {
      TaskStackView stackView = stackViews.get(i);
      if (stackView.getVisibility() != GONE) {
        stackView.layout(
            left, top, left + stackView.getMeasuredWidth(), top + stackView.getMeasuredHeight());
      }
    }
  }