code: private void adaptTitleContainerVisibility() {
          if (titleContainer != null) {
              boolean visible = isCustomTitleUsed() || !TextUtils.isEmpty(title) || icon != null;
  
              if (visible) {
                  titleContainer.setVisibility(View.VISIBLE);
                  notifyOnAreaShown(Area.TITLE);
              } else {
                  titleContainer.setVisibility(View.GONE);
                  notifyOnAreaHidden(Area.TITLE);
              }
          }
      }
docs: Adapts the visibility of the parent view of the text view, which is used to show the title of
  the dialog.