             attrDate.yy_font = AABubbleTextCell.dateFont
             attrDate.yy_color = ActorSDK.sharedActor().style.chatTextDateOutColor
             dateLayout = YYTextLayout(containerSize: CGSizeMake(timeWidth, CGFloat.max), text: attrDate)
+            dateWidth = dateLayout?.textBoundingSize.width
         } else {
             let attrDate = NSMutableAttributedString(string: AACellLayout.formatDate(date))
             attrDate.yy_font = AABubbleTextCell.dateFont
             attrDate.yy_color = ActorSDK.sharedActor().style.chatTextDateInColor
             dateLayout = YYTextLayout(containerSize: CGSizeMake(timeWidth, CGFloat.max), text: attrDate)
+            dateWidth = dateLayout?.textBoundingSize.width
         }
         
         // Calculating bubble height

    private var isClanchTop:Bool = false
    private var isClanchBottom:Bool = false
    
    
    private var messageState = ACMessageState.UNKNOWN().ordinal()
    private var cellLayout: TextCellLayout!

        // Always update bubble insets
        if (isOut) {
            bindBubbleType(.TextOut, isCompact: isClanchBottom)
            
            bubbleInsets = UIEdgeInsets(
                top: (isClanchTop ? AABubbleCell.bubbleTopCompact : AABubbleCell.bubbleTop),
