Skip to content

Commit

Permalink
Merge pull request #8 from quipper/fix_text_alignment
Browse files Browse the repository at this point in the history
fix text alignments
  • Loading branch information
m-sugawara authored Sep 30, 2019
2 parents 2c7ebe2 + 0ccc046 commit 96e43f9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Sources/Views/Cells/TextMessageCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,26 @@ open class TextMessageCell: MessageContentCell {
switch message.kind {
case .announcement(let text):
messageLabel.textAlignment = .center
fallthrough
case .text(let text), .emoji(let text):
messageLabel.text = text

let textColor = displayDelegate.textColor(for: message, at: indexPath, in: messagesCollectionView)
messageLabel.textColor = textColor

if let font = messageLabel.messageLabelFont {
messageLabel.font = font
}
case .text(let text), .emoji(let text):
messageLabel.textAlignment = .left
messageLabel.text = text

let textColor = displayDelegate.textColor(for: message, at: indexPath, in: messagesCollectionView)
messageLabel.textColor = textColor

if let font = messageLabel.messageLabelFont {
messageLabel.font = font
}
case .attributedText(let text):
messageLabel.textAlignment = .left
messageLabel.attributedText = text
default:
break
Expand Down

0 comments on commit 96e43f9

Please sign in to comment.