private DialogAnimation createCircleRevealAnimation ( @ NonNull final View view ) { int [ ] location = new int [ 2 ] ; view . getLocationOnScreen ( location ) ; int margin = getResources ( ) . getDimensionPixelSize ( R . dimen . floating_action_button_margin ) ; int width = view . getWidth ( ) ; int height = view . getHeight ( ) ; float radius = width - margin * 2 ; int x = location [ 0 ] + width / 2 ; int y = location [ 1 ] + height / 2 ; return new CircleRevealAnimation . Builder ( getActivity ( ) ) . setX ( x ) . setY ( y ) . setRadius ( radius ) . create ( ) ; }
Creates and returns the circle reveal animation which should be used to show or hide dialogs .