private void obtainGravity ( @ StyleRes final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogGravity } ) ; setGravity ( typedArray . getInteger ( 0 , Dialog . Gravity . CENTER ) ) ; }
Obtains the gravity from a specific theme .