From 99b76b97345d30768bee81d5e08e8164ba36345e Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 3 Jul 2018 18:41:36 -0400 Subject: [PATCH] Respond to CR. --- .../ConversationView/Cells/OWSContactShareButtonsView.h | 2 -- .../ConversationView/Cells/OWSContactShareButtonsView.m | 5 ++++- .../ConversationView/Cells/OWSMessageBubbleView.m | 8 +++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.h b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.h index 6c4b9b666..4997ef985 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.h +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.h @@ -21,8 +21,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithContactShare:(ContactShareViewModel *)contactShare delegate:(id)delegate; -- (void)createContents; - + (CGFloat)bubbleHeight; // Returns YES IFF the tap was handled. diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.m index fe566f6c8..7df1139d7 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareButtonsView.m @@ -38,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN _delegate = delegate; _contactShare = contactShare; _contactsManager = [Environment current].contactsManager; + + [self createContents]; } return self; @@ -116,7 +118,8 @@ NS_ASSUME_NONNULL_BEGIN UILabel *label = [UILabel new]; self.buttonView = label; if ([OWSContactShareButtonsView hasSendTextButton:self.contactShare contactsManager:self.contactsManager]) { - label.text = NSLocalizedString(@"ACTION_SEND_MESSAGE", @"Label for 'sent message' button in contact view."); + label.text + = NSLocalizedString(@"ACTION_SEND_MESSAGE", @"Label for button that lets you send a message to a contact."); } else if ([OWSContactShareButtonsView hasInviteButton:self.contactShare contactsManager:self.contactsManager]) { label.text = NSLocalizedString(@"ACTION_INVITE", @"Label for 'invite' button in contact view."); } else if ([OWSContactShareButtonsView hasAddToContactsButton:self.contactShare]) { diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index cd14f1f0f..d8d04e8c3 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -506,7 +506,6 @@ NS_ASSUME_NONNULL_BEGIN OWSContactShareButtonsView *buttonsView = [[OWSContactShareButtonsView alloc] initWithContactShare:self.viewItem.contactShare delegate:self]; - [buttonsView createContents]; NSValue *_Nullable actionButtonsSize = [self actionButtonsSize]; OWSAssert(actionButtonsSize); @@ -514,15 +513,14 @@ NS_ASSUME_NONNULL_BEGIN [buttonsView autoSetDimension:ALDimensionHeight toSize:actionButtonsSize.CGSizeValue.height], ]]; - // The "body media" view casts a shadow "downward" onto adjacent views, + // The "contact share" view casts a shadow "downward" onto adjacent views, // so we use a "proxy" view to take its place within the v-stack - // view and then insert the body media view above its proxy so that + // view and then insert the "contact share" view above its proxy so that // it floats above the other content of the bubble view. UIView *proxyView = [UIView new]; [self.stackView addArrangedSubview:proxyView]; - // TODO: We may only end up using a single shadow. OWSBubbleShapeView *shadowView = [OWSBubbleShapeView bubbleShadowView]; OWSBubbleShapeView *clipView = [OWSBubbleShapeView bubbleClipView]; @@ -542,7 +540,7 @@ NS_ASSUME_NONNULL_BEGIN shadowView.fillColor = buttonsView.backgroundColor; shadowView.layer.shadowColor = [UIColor blackColor].CGColor; shadowView.layer.shadowOpacity = 0.12f; - shadowView.layer.shadowOffset = CGSizeMake(0.f, 0.f); + shadowView.layer.shadowOffset = CGSizeZero; shadowView.layer.shadowRadius = 1.f; }