code: private void obtainDialogPadding(@NonNull final TypedArray typedArray) {
          int defaultLeftPadding =
                  getContext().getResources().getDimensionPixelSize(R.dimen.dialog_left_padding);
          int defaultTopPadding =
                  getContext().getResources().getDimensionPixelSize(R.dimen.dialog_top_padding);
          int defaultRightPadding =
                  getContext().getResources().getDimensionPixelSize(R.dimen.dialog_right_padding);
          int defaultBottomPadding =
                  getContext().getResources().getDimensionPixelSize(R.dimen.dialog_bottom_padding);
          int left = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingLeft,
                  defaultLeftPadding);
          int top = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingTop,
                  defaultTopPadding);
          int right = typedArray
                  .getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingRight,
                          defaultRightPadding);
          int bottom = typedArray
                  .getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingBottom,
                          defaultBottomPadding);
          setDialogPadding(left, top, right, bottom);
      }
docs: Obtains the padding of the preference's dialog from a specific typed array.
  
  @param typedArray
  The typed array, the padding should be obtained from, as an instance of the class
  {@link TypedArray}. The typed array may not be null