code: private void obtainDialogPreviewShape(@NonNull final TypedArray typedArray) {
          int defaultValue = getContext().getResources()
                  .getInteger(R.integer.color_palette_preference_default_dialog_preview_shape);
          setDialogPreviewShape(PreviewShape.fromValue(typedArray
                  .getInteger(R.styleable.ColorPalettePreference_dialogPreviewShape, defaultValue)));
      }
docs: Obtains the shape, which should be used to preview colors in the preference's dialog, from a
  specific typed array.
  
  @param typedArray
  The typed array, the shape should be obtained from, as an instance of the class
  {@link TypedArray}. The typed array may not be null