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; stackView.layoutMarginsRelativeArrangement = YES;
[self addSubview:stackView]; [self addSubview:stackView];
[stackView autoCenterInSuperview]; [stackView autoCenterInSuperview];
[NSLayoutConstraint [stackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
autoSetPriority:UILayoutPriorityRequired [stackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
forConstraints:^{ [stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual]; [stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual];
}];
} }
- (void)setIsAttachmentReady:(BOOL)isAttachmentReady - (void)setIsAttachmentReady:(BOOL)isAttachmentReady

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

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

Loading…
Cancel
Save