Merge branch 'charlesmchen/jsqRewriteVsRTL'

pull/1/head
Matthew Chen 8 years ago
commit 103a61d36c

@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN
self.lastProgress = progress; self.lastProgress = progress;
self.isAttachmentReady = self.attachment.isUploaded; self.isAttachmentReady = self.attachment.isUploaded;
} else { } else {
OWSFail(@"%@ Invalid attachment progress.", self.tag); OWSFail(@"%@ Invalid attachment progress.", self.logTag);
self.isAttachmentReady = YES; self.isAttachmentReady = YES;
} }
} }
@ -169,14 +169,14 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Logging #pragma mark - Logging
+ (NSString *)tag + (NSString *)logTag
{ {
return [NSString stringWithFormat:@"[%@]", self.class]; return [NSString stringWithFormat:@"[%@]", self.class];
} }
- (NSString *)tag - (NSString *)logTag
{ {
return self.class.tag; return self.class.logTag;
} }
@end @end

@ -213,7 +213,7 @@ NS_ASSUME_NONNULL_BEGIN
_audioPlayPauseButton = [UIButton buttonWithType:UIButtonTypeCustom]; _audioPlayPauseButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.audioPlayPauseButton.enabled = NO; self.audioPlayPauseButton.enabled = NO;
[contentView addSubview:self.audioPlayPauseButton]; [contentView addSubview:self.audioPlayPauseButton];
[self.audioPlayPauseButton autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:self.audioIconHMargin]; [self.audioPlayPauseButton autoPinLeadingToSuperviewWithMargin:self.audioIconHMargin];
[self.audioPlayPauseButton autoVCenterInSuperview]; [self.audioPlayPauseButton autoVCenterInSuperview];
[self.audioPlayPauseButton autoSetDimension:ALDimensionWidth toSize:self.iconSize]; [self.audioPlayPauseButton autoSetDimension:ALDimensionWidth toSize:self.iconSize];
[self.audioPlayPauseButton autoSetDimension:ALDimensionHeight toSize:self.iconSize]; [self.audioPlayPauseButton autoSetDimension:ALDimensionHeight toSize:self.iconSize];

@ -125,7 +125,7 @@ NS_ASSUME_NONNULL_BEGIN
layer.fillColor = iconColor.CGColor; layer.fillColor = iconColor.CGColor;
}; };
[contentView addSubview:iconCircleView]; [contentView addSubview:iconCircleView];
[iconCircleView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:self.iconHMargin]; [iconCircleView autoPinLeadingToSuperviewWithMargin:self.iconHMargin];
[iconCircleView autoVCenterInSuperview]; [iconCircleView autoVCenterInSuperview];
[iconCircleView autoSetDimension:ALDimensionWidth toSize:self.iconSize]; [iconCircleView autoSetDimension:ALDimensionWidth toSize:self.iconSize];
[iconCircleView autoSetDimension:ALDimensionHeight toSize:self.iconSize]; [iconCircleView autoSetDimension:ALDimensionHeight toSize:self.iconSize];

@ -55,7 +55,10 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
maskedSubview.frame = self.bounds; maskedSubview.frame = self.bounds;
[JSQMessagesMediaViewBubbleImageMasker applyBubbleImageMaskToMediaView:maskedSubview isOutgoing:self.isOutgoing]; // The JSQ masks are not RTL-safe, so we need to invert the
// mask orientation manually.
BOOL hasOutgoingMask = self.isOutgoing ^ self.isRTL;
[JSQMessagesMediaViewBubbleImageMasker applyBubbleImageMaskToMediaView:maskedSubview isOutgoing:hasOutgoingMask];
} }
@end @end

@ -103,12 +103,11 @@ NS_ASSUME_NONNULL_BEGIN
[self textRangeFromPosition:self.beginningOfDocument toPosition:self.beginningOfDocument]; [self textRangeFromPosition:self.beginningOfDocument toPosition:self.beginningOfDocument];
CGRect beginningTextRect = [self firstRectForRange:beginningTextRange]; CGRect beginningTextRect = [self firstRectForRange:beginningTextRange];
CGFloat hInset = beginningTextRect.origin.x;
CGFloat topInset = beginningTextRect.origin.y; CGFloat topInset = beginningTextRect.origin.y;
self.placeholderConstraints = @[ self.placeholderConstraints = @[
[self.placeholderView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:hInset], [self.placeholderView autoPinLeadingToSuperview],
[self.placeholderView autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:hInset], [self.placeholderView autoPinTrailingToSuperview],
[self.placeholderView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:topInset], [self.placeholderView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:topInset],
]; ];
} }

Loading…
Cancel
Save