code: private void inflateTabLayout(@NonNull final View headerView, @NonNull final View contentView) {
          LayoutInflater layoutInflater = LayoutInflater.from(getContext());
          ViewGroup headerContentContainer = headerView.findViewById(R.id.header_content_container);
          ViewGroup contentContainer = contentView.findViewById(R.id.content_container);
  
          if (tabLayout != null) {
              headerContentContainer.removeViewInLayout(tabLayout);
              contentContainer.removeView(tabLayout);
              tabLayout = null;
          }
  
          if (getDialog().isHeaderShown() && getTabPosition() != TabPosition.NO_HEADER &&
                  ((TextUtils.isEmpty(getDialog().getTitle()) &&
                          TextUtils.isEmpty(getDialog().getMessage())) ||
                          getTabPosition() == TabPosition.PREFER_HEADER)) {
              tabLayout = (TabLayout) layoutInflater
                      .inflate(R.layout.wizard_dialog_tab_layout, headerContentContainer, false);
              RelativeLayout.LayoutParams layoutParams =
                      new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
                              RelativeLayout.LayoutParams.WRAP_CONTENT);
              layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
              headerContentContainer.addView(tabLayout, layoutParams);
          } else {
              tabLayout = (TabLayout) layoutInflater
                      .inflate(R.layout.wizard_dialog_tab_layout, contentContainer, false);
              contentContainer.addView(tabLayout, 0);
          }
  
          tabLayout.setupWithViewPager(viewPager);
      }
docs: Inflates the tab layout, which indicates the currently shown fragment.
  
  @param headerView
  The view, which contains the dialog's header, as an instance of the class {@link
  View}. The view may not be null
  @param contentView
  The view, which contains the dialog's content, as an instance of the class {@link
  View}. The view may not be null