                     }) { (finished: Bool) in
                         animation.completion?()
                         if index == lastAnimatedItemIndex {
-                            self.itemsAnimationDidStop()
+                            self.closeAnimationDidStop()
                         }
                     }
                 } else {
                     item.center = center
                     item.alpha = 0.0
-                    if index == lastAnimatedItemIndex {
-                        self.itemsAnimationDidStop()
+                    if self.overlayAnimationType == .none && index == lastAnimatedItemIndex {
+                        self.closeAnimationDidStop()
                     }
                 }
                 

    }
    
    
    fileprivate func itemsAnimationDidStop() {
        isOpen = !isOpen
        if isOpen {
            delegate?.actionButtonDidOpen?(self)
        }
        else {
            reduceContainers()
            delegate?.actionButtonDidClose?(self)
        }
        
        isAnimatingOpenClose = false
    }

// MARK: - Public API
extension UPActionButton {
    
    /* Customization */
    
    open func setShadow(color: UIColor, opacity: Float, radius: CGFloat, offset: CGSize) {
        button.layer.shadowColor = color.cgColor
        button.layer.shadowOpacity = opacity
        button.layer.shadowRadius = radius
        button.layer.shadowOffset = offset
    }
    
    
