private void obtainDialogPreviewBackground ( @ NonNull final TypedArray typedArray ) { int backgroundColor = typedArray . getColor ( R . styleable . ColorPalettePreference_dialogPreviewBackground , - 1 ) ; if ( backgroundColor != - 1 ) { setPreviewBackgroundColor ( backgroundColor ) ; } else { int resourceId = typedArray . getResourceId ( R . styleable . ColorPalettePreference_dialogPreviewBackground , R . drawable . color_picker_default_preview_background ) ; setDialogPreviewBackground ( ContextCompat . getDrawable ( getContext ( ) , resourceId ) ) ; } }
Obtains the background which should be used to preview colors in the preference s dialog from a specific typed array .