|
|
@ -207,7 +207,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
return (TSMessage *)self.viewItem.interaction;
|
|
|
|
return (TSMessage *)self.viewItem.interaction;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)loadForDisplay:(int)contentWidth
|
|
|
|
- (void)loadForDisplay
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OWSAssert(self.viewItem);
|
|
|
|
OWSAssert(self.viewItem);
|
|
|
|
OWSAssert(self.viewItem.interaction);
|
|
|
|
OWSAssert(self.viewItem.interaction);
|
|
|
@ -220,7 +220,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
= isIncoming ? [self.bubbleFactory incoming] : [self.bubbleFactory outgoing];
|
|
|
|
= isIncoming ? [self.bubbleFactory incoming] : [self.bubbleFactory outgoing];
|
|
|
|
self.bubbleImageView.image = bubbleImageData.messageBubbleImage;
|
|
|
|
self.bubbleImageView.image = bubbleImageData.messageBubbleImage;
|
|
|
|
|
|
|
|
|
|
|
|
[self updateDateHeader:contentWidth];
|
|
|
|
[self updateDateHeader];
|
|
|
|
[self updateFooter];
|
|
|
|
[self updateFooter];
|
|
|
|
|
|
|
|
|
|
|
|
switch (self.cellType) {
|
|
|
|
switch (self.cellType) {
|
|
|
@ -263,8 +263,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)updateDateHeader:(int)contentWidth
|
|
|
|
- (void)updateDateHeader
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
OWSAssert(self.contentWidth > 0);
|
|
|
|
|
|
|
|
|
|
|
|
static NSDateFormatter *dateHeaderDateFormatter = nil;
|
|
|
|
static NSDateFormatter *dateHeaderDateFormatter = nil;
|
|
|
|
static NSDateFormatter *dateHeaderTimeFormatter = nil;
|
|
|
|
static NSDateFormatter *dateHeaderTimeFormatter = nil;
|
|
|
|
static dispatch_once_t onceToken;
|
|
|
|
static dispatch_once_t onceToken;
|
|
|
@ -312,7 +314,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
self.dateHeaderConstraints = @[
|
|
|
|
self.dateHeaderConstraints = @[
|
|
|
|
// Date headers should be visually centered within the conversation view,
|
|
|
|
// Date headers should be visually centered within the conversation view,
|
|
|
|
// so they need to extend outside the cell's boundaries.
|
|
|
|
// so they need to extend outside the cell's boundaries.
|
|
|
|
[self.dateHeaderLabel autoSetDimension:ALDimensionWidth toSize:contentWidth],
|
|
|
|
[self.dateHeaderLabel autoSetDimension:ALDimensionWidth toSize:self.contentWidth],
|
|
|
|
(self.isIncoming ? [self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeLeading]
|
|
|
|
(self.isIncoming ? [self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeLeading]
|
|
|
|
: [self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTrailing]),
|
|
|
|
: [self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTrailing]),
|
|
|
|
[self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTop],
|
|
|
|
[self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTop],
|
|
|
|