Introduce message cell footer view.

This commit is contained in:
Matthew Chen 2018-06-26 10:31:05 -04:00
parent 7d5ad0e165
commit 18417edbde
5 changed files with 1 additions and 63 deletions

View file

@ -269,8 +269,6 @@ NS_ASSUME_NONNULL_BEGIN
self.bubbleView.bubbleColor = nil;
}
// CGFloat bottomMargin = 0;
if (self.isQuotedReply) {
BOOL isOutgoing = [self.viewItem.interaction isKindOfClass:TSOutgoingMessage.class];
DisplayableText *_Nullable displayableQuotedText
@ -288,8 +286,6 @@ NS_ASSUME_NONNULL_BEGIN
[self.viewConstraints
addObject:[quotedMessageView autoSetDimension:ALDimensionHeight toSize:quotedMessageContentSize.height]];
// bottomMargin = 0;
[self.bubbleView addPartnerView:quotedMessageView.boundsStrokeView];
}
@ -344,27 +340,6 @@ NS_ASSUME_NONNULL_BEGIN
}
[self.stackView addArrangedSubview:bodyMediaView];
// // This layout can lead to extreme cropping of media content,
// // e.g. a very tall portrait image + long caption. The media
// // view will have "max width", so the image will be cropped to
// // roughly a square.
// // TODO: Myles is considering alternatives.
// [self.viewConstraints addObjectsFromArray:@[
// [bodyMediaView autoPinLeadingToSuperviewMarginWithInset:0],
// [bodyMediaView autoPinTrailingToSuperviewMarginWithInset:0],
// ]];
// // We need constraints to control the vertical sizing of the media view, but we use
// // lower priority so that when a message only contains media it uses the exact bounds of
// // the message view.
// [NSLayoutConstraint
// autoSetPriority:UILayoutPriorityDefaultLow
// forConstraints:^{
// [self.viewConstraints
// addObject:[bodyMediaView autoSetDimension:ALDimensionHeight
// toSize:bodyMediaContentSize.height]];
// }];
// bottomMargin = 0;
BOOL shouldStrokeMediaView = ([bodyMediaView isKindOfClass:[UIImageView class]] ||
[bodyMediaView isKindOfClass:[OWSContactShareView class]]);
@ -437,13 +412,10 @@ NS_ASSUME_NONNULL_BEGIN
OWSFail(@"%@ could not display footer.", self.logTag);
}
// TODO: Should we do this for media content too?
if (textStackView) {
CGSize bubbleSize = [self measureSize];
[self.viewConstraints addObjectsFromArray:@[
[self autoSetDimension:ALDimensionWidth toSize:bubbleSize.width relation:NSLayoutRelationLessThanOrEqual],
// [bodyTextView autoSetDimension:ALDimensionHeight
// toSize:bodyTextContentSize.height],
]];
}
}

View file

@ -55,31 +55,6 @@ NS_ASSUME_NONNULL_BEGIN
[self.statusIndicatorView autoSetDimension:ALDimensionWidth toSize:self.statusIndicatorSize];
[self.statusIndicatorView autoSetDimension:ALDimensionHeight toSize:self.statusIndicatorSize];
self.statusIndicatorView.layer.cornerRadius = self.statusIndicatorSize * 0.5f;
// // TODO: Review constant with Myles.0
// UIStackView *statusStackView = [[UIStackView alloc] initWithArrangedSubviews:@[
// self.statusLabel,
// self.statusIndicatorView,
// ]];
// statusStackView.axis = UILayoutConstraintAxisHorizontal;
// statusStackView.spacing = self.hSpacing;
// [self addSubview:statusStackView];
// [self.timestampLabel autoPinEdgeToSuperviewEdge:ALEdgeLeading];
// [statusStackView autoPinEdgeToSuperviewEdge:ALEdgeTrailing];
// [self.timestampLabel autoVCenterInSuperview];
// [statusStackView autoVCenterInSuperview];
// [self.timestampLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0
// relation:NSLayoutRelationGreaterThanOrEqual]; [self.timestampLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom
// withInset:0
// relation:NSLayoutRelationGreaterThanOrEqual];
// [statusStackView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0
// relation:NSLayoutRelationGreaterThanOrEqual]; [statusStackView autoPinEdgeToSuperviewEdge:ALEdgeBottom
// withInset:0 relation:NSLayoutRelationGreaterThanOrEqual]; [statusStackView autoPinEdge:ALEdgeLeading
// toEdge:ALEdgeTrailing
// ofView:self.timestampLabel
// withOffset:self.hSpacing
// relation:NSLayoutRelationGreaterThanOrEqual];
}
- (void)configureFonts

View file

@ -74,8 +74,6 @@ static const CGFloat kAttachmentDownloadProgressTheta = 0.001f;
for (OWSSignalServiceProtosAttachmentPointer *attachmentProto in attachmentProtos) {
TSAttachmentPointer *pointer = [TSAttachmentPointer attachmentPointerFromProto:attachmentProto relay:relay];
DDLogVerbose(@"%@ ---- creating attachment: %@", self.logTag, pointer.uniqueId);
[DDLog flushLog];
[attachmentIds addObject:pointer.uniqueId];
[pointer saveWithTransaction:transaction];
[attachmentPointers addObject:pointer];

View file

@ -561,9 +561,6 @@ NS_ASSUME_NONNULL_BEGIN
return;
}
DDLogVerbose(@"%@ ---- creating message: %@", self.logTag, attachmentsProcessor.attachmentIds);
[DDLog flushLog];
TSIncomingMessage *_Nullable createdMessage = [self handleReceivedEnvelope:envelope
withDataMessage:dataMessage
attachmentIds:attachmentsProcessor.attachmentIds
@ -1110,9 +1107,6 @@ NS_ASSUME_NONNULL_BEGIN
return;
}
DDLogVerbose(@"%@ ---- creating message 2: %@", self.logTag, incomingMessage.attachmentIds);
[DDLog flushLog];
[incomingMessage saveWithTransaction:transaction];
// Any messages sent from the current user - from this device or another - should be automatically marked as read.

View file

@ -211,8 +211,7 @@ public class FullTextSearchFinder: NSObject {
var oversizeText: String?
dbConnection.read({ (transaction) in
guard let attachment = message.attachment(with: transaction) else {
// This can happen during the initial save of incoming messages.
Logger.warn("Could not load attachment for search indexing.")
owsFail("Could not load attachment for search indexing.")
return
}
guard let attachmentStream = attachment as? TSAttachmentStream else {