Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 196d82c17a
commit d40f74dd0b

@ -74,7 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
buttonStackView.spacing = self.vSpacing; buttonStackView.spacing = self.vSpacing;
// Ensure all of the buttons have the same width. // Ensure all of the buttons have the same width.
buttonStackView.alignment = UIStackViewAlignmentFill; buttonStackView.alignment = UIStackViewAlignmentFill;
buttonStackView.layoutMargins = UIEdgeInsetsZero;
self.stackView = [[UIStackView alloc] initWithArrangedSubviews:@[ self.stackView = [[UIStackView alloc] initWithArrangedSubviews:@[
self.titleLabel, self.titleLabel,
@ -83,7 +82,6 @@ NS_ASSUME_NONNULL_BEGIN
self.stackView.axis = UILayoutConstraintAxisVertical; self.stackView.axis = UILayoutConstraintAxisVertical;
self.stackView.spacing = self.vSpacing; self.stackView.spacing = self.vSpacing;
self.stackView.alignment = UIStackViewAlignmentCenter; self.stackView.alignment = UIStackViewAlignmentCenter;
self.stackView.layoutMargins = UIEdgeInsetsZero;
[self.contentView addSubview:self.stackView]; [self.contentView addSubview:self.stackView];
} }

@ -925,7 +925,7 @@ NS_ASSUME_NONNULL_BEGIN
mediaHeight *= factor; mediaHeight *= factor;
} }
return CGSizeRound(CGSizeMake(mediaWidth, mediaHeight)); result = CGSizeRound(CGSizeMake(mediaWidth, mediaHeight));
break; break;
} }
case OWSMessageCellType_Audio: case OWSMessageCellType_Audio:

@ -66,7 +66,6 @@ NS_ASSUME_NONNULL_BEGIN
self.stackView.axis = UILayoutConstraintAxisHorizontal; self.stackView.axis = UILayoutConstraintAxisHorizontal;
self.stackView.spacing = self.hSpacing; self.stackView.spacing = self.hSpacing;
self.stackView.alignment = UIStackViewAlignmentCenter; self.stackView.alignment = UIStackViewAlignmentCenter;
self.stackView.layoutMargins = UIEdgeInsetsZero;
[self.contentView addSubview:self.stackView]; [self.contentView addSubview:self.stackView];
UITapGestureRecognizer *tap = UITapGestureRecognizer *tap =

@ -260,7 +260,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
return measurementCell; return measurementCell;
} }
- (CGFloat)vSpacingWithLastLayoutItem:(id<ConversationViewLayoutItem>)lastLayoutItem - (CGFloat)vSpacingWithPreviousLayoutItem:(id<ConversationViewLayoutItem>)lastLayoutItem
{ {
OWSAssert(lastLayoutItem); OWSAssert(lastLayoutItem);

@ -21,7 +21,7 @@ typedef NS_ENUM(NSInteger, ConversationViewLayoutAlignment) {
- (ConversationViewLayoutAlignment)layoutAlignment; - (ConversationViewLayoutAlignment)layoutAlignment;
- (CGFloat)vSpacingWithLastLayoutItem:(id<ConversationViewLayoutItem>)lastLayoutItem; - (CGFloat)vSpacingWithPreviousLayoutItem:(id<ConversationViewLayoutItem>)lastLayoutItem;
@end @end

@ -102,10 +102,10 @@ NS_ASSUME_NONNULL_BEGIN
CGFloat contentBottom = y; CGFloat contentBottom = y;
NSInteger row = 0; NSInteger row = 0;
id<ConversationViewLayoutItem> _Nullable lastLayoutItem = nil; id<ConversationViewLayoutItem> _Nullable previousLayoutItem = nil;
for (id<ConversationViewLayoutItem> layoutItem in layoutItems) { for (id<ConversationViewLayoutItem> layoutItem in layoutItems) {
if (lastLayoutItem) { if (previousLayoutItem) {
y += [layoutItem vSpacingWithLastLayoutItem:lastLayoutItem]; y += [layoutItem vSpacingWithPreviousLayoutItem:previousLayoutItem];
} }
CGSize layoutSize = CGSizeCeil([layoutItem cellSize]); CGSize layoutSize = CGSizeCeil([layoutItem cellSize]);
@ -126,7 +126,7 @@ NS_ASSUME_NONNULL_BEGIN
contentBottom = itemFrame.origin.y + itemFrame.size.height; contentBottom = itemFrame.origin.y + itemFrame.size.height;
y = contentBottom; y = contentBottom;
row++; row++;
lastLayoutItem = layoutItem; previousLayoutItem = layoutItem;
} }
contentBottom += self.layoutInfo.contentMarginBottom; contentBottom += self.layoutInfo.contentMarginBottom;

@ -74,6 +74,8 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
self.uiDatabaseConnection.beginLongLivedReadTransaction() self.uiDatabaseConnection.beginLongLivedReadTransaction()
updateDBConnectionAndMessageToLatest() updateDBConnectionAndMessageToLatest()
self.conversationLayoutInfo.viewWidth = view.width()
self.navigationItem.title = NSLocalizedString("MESSAGE_METADATA_VIEW_TITLE", self.navigationItem.title = NSLocalizedString("MESSAGE_METADATA_VIEW_TITLE",
comment: "Title for the 'message metadata' view.") comment: "Title for the 'message metadata' view.")

Loading…
Cancel
Save