code: private void obtainPadding(@StyleRes final int themeResourceId) {
          TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                  new int[]{R.attr.materialDialogPaddingLeft, R.attr.materialDialogPaddingTop,
                          R.attr.materialDialogPaddingRight, R.attr.materialDialogPaddingBottom});
          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(0, defaultLeftPadding);
          int top = typedArray.getDimensionPixelSize(1, defaultTopPadding);
          int right = typedArray.getDimensionPixelSize(2, defaultRightPadding);
          int bottom = typedArray.getDimensionPixelSize(3, defaultBottomPadding);
          setPadding(left, top, right, bottom);
      }
docs: Obtains the üadding from a specific theme.
  
  @param themeResourceId
  The resource id of the theme, the padding should be obtained from, as an {@link
  Integer} value