private void obtainColorPalette ( @ NonNull final TypedArray typedArray ) { int resourceId = typedArray . getResourceId ( R . styleable . ColorPalettePreference_colorPalette , - 1 ) ; if ( resourceId != - 1 ) { int [ ] obtainedColorPalette = getContext ( ) . getResources ( ) . getIntArray ( resourceId ) ; setColorPalette ( obtainedColorPalette ) ; } }
Obtains the color palette from a specific typed array .