protected void restoreSubActionViewAfterAnimation ( FloatingActionMenu . Item subActionItem , ActionType actionType ) { ViewGroup . LayoutParams params = subActionItem . view . getLayoutParams ( ) ; subActionItem . view . setTranslationX ( 0 ) ; subActionItem . view . setTranslationY ( 0 ) ; subActionItem . view . setRotation ( 0 ) ; subActionItem . view . setScaleX ( 1 ) ; subActionItem . view . setScaleY ( 1 ) ; subActionItem . view . setAlpha ( 1 ) ; if ( actionType == ActionType . OPENING ) { FrameLayout . LayoutParams lp = ( FrameLayout . LayoutParams ) params ; if ( menu . isSystemOverlay ( ) ) { WindowManager . LayoutParams overlayParams = ( WindowManager . LayoutParams ) menu . getOverlayContainer ( ) . getLayoutParams ( ) ; lp . setMargins ( subActionItem . x - overlayParams . x , subActionItem . y - overlayParams . y , 0 , 0 ) ; } else { lp . setMargins ( subActionItem . x , subActionItem . y , 0 , 0 ) ; } subActionItem . view . setLayoutParams ( lp ) ; } else if ( actionType == ActionType . CLOSING ) { Point center = menu . getActionViewCenter ( ) ; FrameLayout . LayoutParams lp = ( FrameLayout . LayoutParams ) params ; if ( menu . isSystemOverlay ( ) ) { WindowManager . LayoutParams overlayParams = ( WindowManager . LayoutParams ) menu . getOverlayContainer ( ) . getLayoutParams ( ) ; lp . setMargins ( center . x - overlayParams . x - subActionItem . width / 2 , center . y - overlayParams . y - subActionItem . height / 2 , 0 , 0 ) ; } else { lp . setMargins ( center . x - subActionItem . width / 2 , center . y - subActionItem . height / 2 , 0 , 0 ) ; } subActionItem . view . setLayoutParams ( lp ) ; menu . removeViewFromCurrentContainer ( subActionItem . view ) ; if ( menu . isSystemOverlay ( ) ) { // When all the views are removed from the overlay container, // we also need to detach it if ( menu . getOverlayContainer ( ) . getChildCount ( ) == 0 ) { menu . detachOverlayContainer ( ) ; } } } }
Restores the specified sub action view to its final state according to the current actionType Should be called after an animation finishes .