From 1bc8697d7d75be96ad4bf774caba20f506b40655 Mon Sep 17 00:00:00 2001 From: kevinzhow Date: Tue, 3 Nov 2015 07:56:18 +0800 Subject: [PATCH] Move to YepConfig.ChatCell.bubbleCornerRadius --- Yep/Configs/YepConfig.swift | 2 ++ Yep/Views/Cells/ChatLeftText/ChatLeftTextCell.swift | 2 +- Yep/Views/Cells/ChatRightText/ChatRightTextCell.swift | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Yep/Configs/YepConfig.swift b/Yep/Configs/YepConfig.swift index a694c332..7a87e7ca 100644 --- a/Yep/Configs/YepConfig.swift +++ b/Yep/Configs/YepConfig.swift @@ -169,6 +169,8 @@ class YepConfig { static let mediaMinHeight: CGFloat = 30 static let centerXOffset: CGFloat = 4 + + static let bubbleCornerRadius: CGFloat = 20 static let imageAppearDuration: NSTimeInterval = 0.1 diff --git a/Yep/Views/Cells/ChatLeftText/ChatLeftTextCell.swift b/Yep/Views/Cells/ChatLeftText/ChatLeftTextCell.swift index f47754dc..a94a8f45 100644 --- a/Yep/Views/Cells/ChatLeftText/ChatLeftTextCell.swift +++ b/Yep/Views/Cells/ChatLeftText/ChatLeftTextCell.swift @@ -113,7 +113,7 @@ class ChatLeftTextCell: ChatBaseCell { let bubbleBodyFrame = CGRectInset(strongSelf.textContainerView.frame, -12, -3) - strongSelf.bubbleBodyShapeLayer.path = UIBezierPath(roundedRect: bubbleBodyFrame, byRoundingCorners: UIRectCorner.AllCorners, cornerRadii: CGSize(width: 18, height: 18)).CGPath + strongSelf.bubbleBodyShapeLayer.path = UIBezierPath(roundedRect: bubbleBodyFrame, byRoundingCorners: UIRectCorner.AllCorners, cornerRadii: CGSize(width: YepConfig.ChatCell.bubbleCornerRadius, height: YepConfig.ChatCell.bubbleCornerRadius)).CGPath if strongSelf.inGroup { strongSelf.nameLabel.text = strongSelf.user?.nickname diff --git a/Yep/Views/Cells/ChatRightText/ChatRightTextCell.swift b/Yep/Views/Cells/ChatRightText/ChatRightTextCell.swift index 70e40651..689dac8a 100644 --- a/Yep/Views/Cells/ChatRightText/ChatRightTextCell.swift +++ b/Yep/Views/Cells/ChatRightText/ChatRightTextCell.swift @@ -105,7 +105,7 @@ class ChatRightTextCell: ChatRightBaseCell { let bubbleBodyFrame = CGRectInset(strongSelf.textContainerView.frame, -12, -3) - strongSelf.bubbleBodyShapeLayer.path = UIBezierPath(roundedRect: bubbleBodyFrame, byRoundingCorners: UIRectCorner.AllCorners, cornerRadii: CGSize(width: 18, height: 18)).CGPath + strongSelf.bubbleBodyShapeLayer.path = UIBezierPath(roundedRect: bubbleBodyFrame, byRoundingCorners: UIRectCorner.AllCorners, cornerRadii: CGSize(width: YepConfig.ChatCell.bubbleCornerRadius, height: YepConfig.ChatCell.bubbleCornerRadius)).CGPath // strongSelf.bubbleBodyImageView.frame = strongSelf.bubbleTailImageView.center = CGPoint(x: CGRectGetMaxX(bubbleBodyFrame), y: CGRectGetMidY(strongSelf.avatarImageView.frame))