Merge pull request #374 from RyanRory/quote-view-improvement

UI Fix
pull/376/head
Niels Andriesse 3 years ago committed by GitHub
commit 650cba8cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -178,7 +178,9 @@ final class QuoteView : UIView {
imageView.set(.width, to: thumbnailSize)
imageView.set(.height, to: thumbnailSize)
mainStackView.addArrangedSubview(imageView)
body = (thumbnail != nil) ? "Image" : (isAudio ? "Audio" : "Document")
if (body ?? "").isEmpty {
body = (thumbnail != nil) ? "Image" : (isAudio ? "Audio" : "Document")
}
}
// Body label
let bodyLabel = UILabel()
@ -189,9 +191,11 @@ final class QuoteView : UIView {
bodyLabel.attributedText = given(body) { MentionUtilities.highlightMentions(in: $0, isOutgoingMessage: isOutgoing, threadID: threadID, attributes: [:]) }
?? given(attachments.first?.contentType) { NSAttributedString(string: MIMETypeUtil.isAudio($0) ? "Audio" : "Document") } ?? NSAttributedString(string: "Document")
bodyLabel.textColor = textColor
/*
if hasAttachments {
bodyLabel.numberOfLines = 1
}
*/
let bodyLabelSize = bodyLabel.systemLayoutSizeFitting(availableSpace)
// Label stack view
var authorLabelHeight: CGFloat?

@ -561,7 +561,8 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate {
switch viewItem.interaction.interactionType() {
case .outgoingMessage: return screen.width - contactThreadHSpacing - gutterSize
case .incomingMessage:
let leftGutterSize = shouldShowProfilePicture(for: viewItem) ? gutterSize : contactThreadHSpacing
let isGroupThread = viewItem.interaction.thread.isGroupThread()
let leftGutterSize = isGroupThread ? gutterSize : contactThreadHSpacing
return screen.width - leftGutterSize - gutterSize
default: preconditionFailure()
}

Loading…
Cancel
Save