code: private void obtainDialogTheme(@NonNull final TypedArray typedArray) {
          int themeId = typedArray.getResourceId(R.styleable.DialogPreference_dialogThemeResource, 0);
  
          if (themeId == 0) {
              TypedValue typedValue = new TypedValue();
              getContext().getTheme()
                      .resolveAttribute(R.attr.preferenceDialogTheme, typedValue, true);
              themeId = typedValue.resourceId;
          }
  
          dialogTheme = themeId != 0 ? themeId : R.style.MaterialDialog_Light;
      }
docs: Obtains the theme, which should be used by the preference's dialog, from a specific typed
  array.
  
  @param typedArray
  The typed array, the theme should be obtained from, as an instance of the class
  {@link TypedArray}. The typed array may not be null