|
|
@ -730,18 +730,21 @@ static void *kConversationInputTextViewObservingContext = &kConversationInputTex
|
|
|
|
[cancelButtonWrapper
|
|
|
|
[cancelButtonWrapper
|
|
|
|
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
|
|
|
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
|
|
|
action:@selector(cancelButtonWrapperTapped:)]];
|
|
|
|
action:@selector(cancelButtonWrapperTapped:)]];
|
|
|
|
UIView *_Nullable cancelButtonSuperview = [self.attachmentView contentView];
|
|
|
|
UIView *_Nullable attachmentContentView = [self.attachmentView contentView];
|
|
|
|
if (cancelButtonSuperview) {
|
|
|
|
// Place the cancel button inside the attachment view's content area,
|
|
|
|
cancelButtonSuperview.layer.borderColor = self.inputTextView.layer.borderColor;
|
|
|
|
// if possible. If not, just place it inside the attachment view.
|
|
|
|
cancelButtonSuperview.layer.borderWidth = self.inputTextView.layer.borderWidth;
|
|
|
|
UIView *cancelButtonReferenceView = attachmentContentView;
|
|
|
|
cancelButtonSuperview.layer.cornerRadius = self.inputTextView.layer.cornerRadius;
|
|
|
|
if (attachmentContentView) {
|
|
|
|
cancelButtonSuperview.clipsToBounds = YES;
|
|
|
|
attachmentContentView.layer.borderColor = self.inputTextView.layer.borderColor;
|
|
|
|
|
|
|
|
attachmentContentView.layer.borderWidth = self.inputTextView.layer.borderWidth;
|
|
|
|
|
|
|
|
attachmentContentView.layer.cornerRadius = self.inputTextView.layer.cornerRadius;
|
|
|
|
|
|
|
|
attachmentContentView.clipsToBounds = YES;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
cancelButtonSuperview = self.attachmentView;
|
|
|
|
cancelButtonReferenceView = self.attachmentView;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[cancelButtonSuperview addSubview:cancelButtonWrapper];
|
|
|
|
[self.contentView addSubview:cancelButtonWrapper];
|
|
|
|
[cancelButtonWrapper autoPinEdgeToSuperviewEdge:ALEdgeTop];
|
|
|
|
[cancelButtonWrapper autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:cancelButtonReferenceView];
|
|
|
|
[cancelButtonWrapper autoPinEdgeToSuperviewEdge:ALEdgeRight];
|
|
|
|
[cancelButtonWrapper autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:cancelButtonReferenceView];
|
|
|
|
|
|
|
|
|
|
|
|
UIImage *cancelIcon = [UIImage imageNamed:@"cancel-cross-white"];
|
|
|
|
UIImage *cancelIcon = [UIImage imageNamed:@"cancel-cross-white"];
|
|
|
|
OWSAssert(cancelIcon);
|
|
|
|
OWSAssert(cancelIcon);
|
|
|
|