code: private void obtainTitleColor(@StyleRes final int themeResourceId) {
          TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                  new int[]{R.attr.materialDialogTitleColor});
          int defaultColor =
                  ThemeUtil.getColor(getContext(), themeResourceId, android.R.attr.textColorPrimary);
          setTitleColor(typedArray.getColor(0, defaultColor));
      }
docs: Obtains the title color from a specific theme.
  
  @param themeResourceId
  The resource id of the theme, the title color should be obtained from, as an {@link
  Integer} value