Merge branch 'charlesmchen/fixCellLayoutBreakage'

pull/1/head
Matthew Chen 7 years ago
commit 92f63cdb16

@ -404,9 +404,9 @@ NS_ASSUME_NONNULL_BEGIN
[self.viewConstraints addObjectsFromArray:@[ [self.viewConstraints addObjectsFromArray:@[
[bodyTextView autoPinLeadingToSuperviewMarginWithInset:textInsets.leading], [bodyTextView autoPinLeadingToSuperviewMarginWithInset:textInsets.leading],
[bodyTextView autoPinTrailingToSuperviewMarginWithInset:textInsets.trailing], [bodyTextView autoPinTrailingToSuperviewMarginWithInset:textInsets.trailing],
[bodyTextView autoSetDimension:ALDimensionWidth toSize:bodyTextContentSize.width],
[bodyTextView autoSetDimension:ALDimensionHeight toSize:bodyTextContentSize.height],
]]; ]];
[self.viewConstraints
addObject:[bodyTextView autoSetDimension:ALDimensionHeight toSize:bodyTextContentSize.height]];
if (lastSubview) { if (lastSubview) {
[self.viewConstraints addObject:[bodyTextView autoPinEdge:ALEdgeTop [self.viewConstraints addObject:[bodyTextView autoPinEdge:ALEdgeTop

@ -114,7 +114,7 @@ public class ConversationLayoutInfo: NSObject {
fullWidthContentWidth = viewWidth - (fullWidthGutterLeading + fullWidthGutterTrailing) fullWidthContentWidth = viewWidth - (fullWidthGutterLeading + fullWidthGutterTrailing)
maxMessageWidth = floor(contentWidth * 0.8) maxMessageWidth = floor(contentWidth * 0.9)
// TODO: Should this be different? // TODO: Should this be different?
maxFooterWidth = maxMessageWidth - 10 maxFooterWidth = maxMessageWidth - 10

@ -261,14 +261,20 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
return measurementCell; return measurementCell;
} }
- (CGFloat)vSpacingWithPreviousLayoutItem:(id<ConversationViewLayoutItem>)lastLayoutItem - (CGFloat)vSpacingWithPreviousLayoutItem:(ConversationViewItem *)previousLayoutItem
{ {
OWSAssert(lastLayoutItem); OWSAssert(previousLayoutItem);
// TODO: if (self.interaction.interactionType == OWSInteractionType_UnreadIndicator
|| previousLayoutItem.interaction.interactionType == OWSInteractionType_UnreadIndicator) {
// The unread indicator has its own v-margins.
return 0.f; return 0.f;
} }
// TODO:
return 4.f;
}
- (ConversationViewCell *)dequeueCellForCollectionView:(UICollectionView *)collectionView - (ConversationViewCell *)dequeueCellForCollectionView:(UICollectionView *)collectionView
indexPath:(NSIndexPath *)indexPath indexPath:(NSIndexPath *)indexPath
{ {

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

@ -345,7 +345,8 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
self.messageBubbleView = messageBubbleView self.messageBubbleView = messageBubbleView
messageBubbleView.viewItem = viewItem messageBubbleView.viewItem = viewItem
messageBubbleView.cellMediaCache = NSCache() messageBubbleView.cellMediaCache = NSCache()
messageBubbleView.layoutInfo = self.conversationLayoutInfo let conversationLayoutInfo = ConversationLayoutInfo(thread: thread)
messageBubbleView.layoutInfo = conversationLayoutInfo
messageBubbleView.configureViews() messageBubbleView.configureViews()
messageBubbleView.loadContent() messageBubbleView.loadContent()

Loading…
Cancel
Save