code: private void adaptTitleContainerVisibility() {
          if (titleContainer != null) {
              if (customTitleView == null && customTitleViewId == -1) {
                  titleContainer.setVisibility(
                          !TextUtils.isEmpty(title) || icon != null ? View.VISIBLE : View.GONE);
              } else {
                  titleContainer.setVisibility(View.VISIBLE);
              }
          }
      }
docs: Adapts the visibility of the layout, which is used to show the bottom sheet's title.