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