code: private void obtainDialogMaxHeight(@NonNull final TypedArray typedArray) {
          try {
              int maxHeight = typedArray
                      .getDimensionPixelSize(R.styleable.DialogPreference_dialogMaxHeight, -1);
  
              if (maxHeight != -1) {
                  setDialogMaxHeight(maxHeight);
              }
          } catch (Resources.NotFoundException | UnsupportedOperationException e) {
              // No need to handle
          }
      }
docs: Obtains the maximum height of the preference's dialog from a specific typed array.
  
  @param typedArray
  The typed array, the maximum height should be obtained from, as an instance of the
  class {@link TypedArray}. The typed array may not be null