Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent c70d33b9e4
commit a9c7e77b84

@ -95,14 +95,10 @@ NS_ASSUME_NONNULL_BEGIN
stackView.layoutMarginsRelativeArrangement = YES;
[self addSubview:stackView];
[stackView autoCenterInSuperview];
[NSLayoutConstraint
autoSetPriority:UILayoutPriorityRequired
forConstraints:^{
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual];
}];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual];
}
- (void)setIsAttachmentReady:(BOOL)isAttachmentReady

@ -473,12 +473,9 @@ NS_ASSUME_NONNULL_BEGIN
[self insertAnyTextViewsIntoStackView:textViews];
CGSize bubbleSize = [self measureSize];
[NSLayoutConstraint autoSetPriority:UILayoutPriorityRequired
forConstraints:^{
[self.viewConstraints addObjectsFromArray:@[
[self autoSetDimension:ALDimensionWidth toSize:bubbleSize.width],
]];
}];
[self.viewConstraints addObjectsFromArray:@[
[self autoSetDimension:ALDimensionWidth toSize:bubbleSize.width],
]];
if (bodyMediaView) {
OWSAssert(bodyMediaSize);
[self.viewConstraints
@ -977,7 +974,7 @@ NS_ASSUME_NONNULL_BEGIN
UIImageView *videoPlayButton = [[UIImageView alloc] initWithImage:videoPlayIcon];
[stillImageView addSubview:videoPlayButton];
[videoPlayButton autoCenterInSuperview];
[self addAttachmentUploadViewIfNecessary:^(BOOL isAttachmentReady) {
[self addAttachmentUploadViewIfNecessaryWithAttachmentStateCallback:^(BOOL isAttachmentReady) {
videoPlayButton.hidden = !isAttachmentReady;
}];
@ -1078,10 +1075,11 @@ NS_ASSUME_NONNULL_BEGIN
- (void)addAttachmentUploadViewIfNecessary
{
[self addAttachmentUploadViewIfNecessary:nil];
[self addAttachmentUploadViewIfNecessaryWithAttachmentStateCallback:nil];
}
- (void)addAttachmentUploadViewIfNecessary:(nullable AttachmentStateBlock)attachmentStateCallback
- (void)addAttachmentUploadViewIfNecessaryWithAttachmentStateCallback:
(nullable AttachmentStateBlock)attachmentStateCallback
{
OWSAssert(self.attachmentStream);

@ -48,10 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
// It's inner (private) MTKView is below the status bar.
for (UIView *subview in [_videoRenderer subviews]) {
if ([subview isKindOfClass:[MTKView class]]) {
[NSLayoutConstraint autoSetPriority:UILayoutPriorityRequired
forConstraints:^{
[subview autoPinEdgesToSuperviewEdges];
}];
[subview autoPinEdgesToSuperviewEdges];
} else {
OWSFail(@"New subviews added to MTLVideoView. Reconsider this hack.");
}

Loading…
Cancel
Save