From 63fa6f5c0011900b9cee37d9257f3cb79cf42e80 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Jun 2018 14:33:45 -0400 Subject: [PATCH 1/6] Tweak read indicator color. --- .../ConversationView/Cells/OWSMessageFooterView.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m index 2625e36ca..1cb18f2f1 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m @@ -117,8 +117,7 @@ NS_ASSUME_NONNULL_BEGIN self.statusIndicatorImageView.image = [statusIndicatorImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; if (messageStatus == MessageReceiptStatusRead) { - // TODO: Tint the icon with the conversation color. - self.statusIndicatorImageView.tintColor = textColor; + self.statusIndicatorImageView.tintColor = [UIColor ows_signalBlueColor]; } else { self.statusIndicatorImageView.tintColor = textColor; } From 2653ed7e3fb4f7eb9b414d076ff5410ac85f0fdd Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Jun 2018 14:57:33 -0400 Subject: [PATCH 2/6] Apply conversation colors. --- .../Cells/OWSContactShareView.m | 9 ++++--- .../Cells/OWSMessageBubbleView.m | 6 +++-- .../Cells/OWSQuotedMessageView.h | 3 ++- .../Cells/OWSQuotedMessageView.m | 24 ++++++++++++------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareView.m index 1d1e20749..c5d5e4fc4 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactShareView.m @@ -172,6 +172,8 @@ NS_ASSUME_NONNULL_BEGIN { self.layoutMargins = UIEdgeInsetsZero; + UIColor *textColor = (self.isIncoming ? [UIColor ows_whiteColor] : [UIColor ows_light90Color]); + AvatarImageView *avatarView = [AvatarImageView new]; avatarView.image = [self.contactShare getAvatarImageWithDiameter:self.iconSize contactsManager:self.contactsManager]; @@ -183,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *topLabel = [UILabel new]; topLabel.text = self.contactShare.displayName; - topLabel.textColor = [UIColor blackColor]; + topLabel.textColor = textColor; topLabel.lineBreakMode = NSLineBreakByTruncatingTail; topLabel.font = OWSContactShareView.nameFont; @@ -197,7 +199,8 @@ NS_ASSUME_NONNULL_BEGIN if (firstPhoneNumber.length > 0) { UILabel *bottomLabel = [UILabel new]; bottomLabel.text = [PhoneNumber bestEffortLocalizedPhoneNumberWithE164:firstPhoneNumber]; - bottomLabel.textColor = [UIColor ows_darkGrayColor]; + // TODO: + bottomLabel.textColor = [textColor colorWithAlphaComponent:0.7f]; bottomLabel.lineBreakMode = NSLineBreakByTruncatingTail; bottomLabel.font = OWSContactShareView.subtitleFont; [labelsView addArrangedSubview:bottomLabel]; @@ -208,7 +211,7 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(disclosureImage); UIImageView *disclosureImageView = [UIImageView new]; disclosureImageView.image = [disclosureImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - disclosureImageView.tintColor = [UIColor blackColor]; + disclosureImageView.tintColor = textColor; [disclosureImageView setCompressionResistanceHigh]; [disclosureImageView setContentHuggingHigh]; diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index 5c734e2a4..c8483ed5d 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -285,7 +285,8 @@ NS_ASSUME_NONNULL_BEGIN [OWSQuotedMessageView quotedMessageViewForConversation:self.viewItem.quotedReply displayableQuotedText:displayableQuotedText conversationStyle:self.conversationStyle - isOutgoing:isOutgoing]; + isOutgoing:isOutgoing + sharesTopBorderWithMessageBubble:!self.shouldShowSenderName]; quotedMessageView.delegate = self; self.quotedMessageView = quotedMessageView; @@ -1130,7 +1131,8 @@ NS_ASSUME_NONNULL_BEGIN [OWSQuotedMessageView quotedMessageViewForConversation:self.viewItem.quotedReply displayableQuotedText:displayableQuotedText conversationStyle:self.conversationStyle - isOutgoing:isOutgoing]; + isOutgoing:isOutgoing + sharesTopBorderWithMessageBubble:NO]; CGSize result = [quotedMessageView sizeForMaxWidth:self.conversationStyle.maxMessageWidth]; return [NSValue valueWithCGSize:CGSizeCeil(result)]; } diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.h b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.h index edd18e8c7..83fb17150 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.h +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.h @@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN + (OWSQuotedMessageView *)quotedMessageViewForConversation:(OWSQuotedReplyModel *)quotedMessage displayableQuotedText:(nullable DisplayableText *)displayableQuotedText conversationStyle:(ConversationStyle *)conversationStyle - isOutgoing:(BOOL)isOutgoing; + isOutgoing:(BOOL)isOutgoing + sharesTopBorderWithMessageBubble:(BOOL)sharesTopBorderWithMessageBubble; // Factory method for "message compose" views. + (OWSQuotedMessageView *)quotedMessageViewForPreview:(OWSQuotedReplyModel *)quotedMessage diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index ca0cbaac3..f0adfd989 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) BOOL isForPreview; @property (nonatomic, readonly) BOOL isOutgoing; +@property (nonatomic, readonly) BOOL sharesTopBorderWithMessageBubble; @property (nonatomic, readonly) UILabel *quotedAuthorLabel; @property (nonatomic, readonly) UILabel *quotedTextLabel; @@ -39,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN displayableQuotedText:(nullable DisplayableText *)displayableQuotedText conversationStyle:(ConversationStyle *)conversationStyle isOutgoing:(BOOL)isOutgoing + sharesTopBorderWithMessageBubble:(BOOL)sharesTopBorderWithMessageBubble { OWSAssert(quotedMessage); @@ -46,7 +48,8 @@ NS_ASSUME_NONNULL_BEGIN displayableQuotedText:displayableQuotedText conversationStyle:conversationStyle isForPreview:NO - isOutgoing:isOutgoing]; + isOutgoing:isOutgoing + sharesTopBorderWithMessageBubble:sharesTopBorderWithMessageBubble]; } + (OWSQuotedMessageView *)quotedMessageViewForPreview:(OWSQuotedReplyModel *)quotedMessage @@ -63,7 +66,8 @@ NS_ASSUME_NONNULL_BEGIN displayableQuotedText:displayableQuotedText conversationStyle:conversationStyle isForPreview:YES - isOutgoing:YES]; + isOutgoing:YES + sharesTopBorderWithMessageBubble:NO]; [instance createContents]; return instance; } @@ -73,6 +77,7 @@ NS_ASSUME_NONNULL_BEGIN conversationStyle:(ConversationStyle *)conversationStyle isForPreview:(BOOL)isForPreview isOutgoing:(BOOL)isOutgoing + sharesTopBorderWithMessageBubble:(BOOL)sharesTopBorderWithMessageBubble { self = [super init]; @@ -87,6 +92,7 @@ NS_ASSUME_NONNULL_BEGIN _isForPreview = isForPreview; _conversationStyle = conversationStyle; _isOutgoing = isOutgoing; + _sharesTopBorderWithMessageBubble = sharesTopBorderWithMessageBubble; _quotedAuthorLabel = [UILabel new]; _quotedTextLabel = [UILabel new]; @@ -140,6 +146,7 @@ NS_ASSUME_NONNULL_BEGIN self.clipsToBounds = YES; CAShapeLayer *maskLayer = [CAShapeLayer new]; + BOOL sharesTopBorderWithMessageBubble = self.sharesTopBorderWithMessageBubble; OWSLayerView *innerBubbleView = [[OWSLayerView alloc] initWithFrame:CGRectZero layoutCallback:^(UIView *layerView) { @@ -151,9 +158,8 @@ NS_ASSUME_NONNULL_BEGIN CGFloat bubbleRight = layerFrame.size.width; CGFloat bubbleTop = 0.f; CGFloat bubbleBottom = layerFrame.size.height; - // TODO: - CGFloat bubbleTopRounding = 12.f; - CGFloat bubbleBottomRounding = 12.f; + CGFloat bubbleTopRounding = (sharesTopBorderWithMessageBubble ? 10.f : 4.f); + CGFloat bubbleBottomRounding = 4.f; [bezierPath moveToPoint:CGPointMake(bubbleLeft + bubbleTopRounding, bubbleTop)]; [bezierPath addLineToPoint:CGPointMake(bubbleRight - bubbleTopRounding, bubbleTop)]; @@ -172,8 +178,9 @@ NS_ASSUME_NONNULL_BEGIN maskLayer.path = bezierPath.CGPath; }]; innerBubbleView.layer.mask = maskLayer; - // TODO: Color. - innerBubbleView.backgroundColor = [[UIColor ows_cyan800Color] colorWithAlphaComponent:0.25f]; + innerBubbleView.backgroundColor + = (self.isOutgoing ? [self.conversationStyle.primaryColor colorWithAlphaComponent:0.25f] + : [UIColor colorWithWhite:1.f alpha:0.75f]); [self addSubview:innerBubbleView]; [innerBubbleView autoPinLeadingToSuperviewMarginWithInset:self.bubbleHMargin]; [innerBubbleView autoPinTrailingToSuperviewMarginWithInset:self.bubbleHMargin]; @@ -187,8 +194,7 @@ NS_ASSUME_NONNULL_BEGIN [hStackView autoPinToSuperviewEdges]; UIView *stripeView = [UIView new]; - // TODO: Color. - stripeView.backgroundColor = [UIColor ows_cyan800Color]; + stripeView.backgroundColor = (self.isOutgoing ? [self.conversationStyle primaryColor] : [UIColor whiteColor]); [stripeView autoSetDimension:ALDimensionWidth toSize:self.stripeThickness]; [stripeView setContentHuggingHigh]; [stripeView setCompressionResistanceHigh]; From 0c4470bb340e5f3582b0233a1755101b0c74631c Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Jun 2018 15:09:05 -0400 Subject: [PATCH 3/6] Tweak colors. --- .../Cells/OWSGenericAttachmentView.m | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSGenericAttachmentView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSGenericAttachmentView.m index f7d6e76ed..ad0af852e 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSGenericAttachmentView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSGenericAttachmentView.m @@ -4,7 +4,6 @@ #import "OWSGenericAttachmentView.h" #import "OWSBezierPathView.h" -#import "UIColor+OWS.h" #import "UIFont+OWS.h" #import "UIView+OWS.h" #import "ViewControllerUtils.h" @@ -85,25 +84,8 @@ NS_ASSUME_NONNULL_BEGIN return 48.f; } -- (UIColor *)bubbleBackgroundColor -{ - return self.isIncoming ? [UIColor ows_messageBubbleLightGrayColor] : [UIColor ows_materialBlueColor]; -} - -- (UIColor *)textColor -{ - return (self.isIncoming ? [UIColor colorWithWhite:0.2f alpha:1.f] : [UIColor whiteColor]); -} - -- (UIColor *)foregroundColorWithOpacity:(CGFloat)alpha -{ - return [self.textColor blendWithColor:self.bubbleBackgroundColor alpha:alpha]; -} - - (void)createContents { - UIColor *textColor = (self.isIncoming ? [UIColor colorWithWhite:0.2 alpha:1.f] : [UIColor whiteColor]); - self.axis = UILayoutConstraintAxisHorizontal; self.alignment = UIStackViewAlignmentCenter; self.spacing = self.hSpacing; @@ -115,7 +97,6 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(image.size.height == self.iconHeight); UIImageView *imageView = [UIImageView new]; imageView.image = image; - imageView.tintColor = self.bubbleBackgroundColor; [self addArrangedSubview:imageView]; [imageView setContentHuggingHigh]; @@ -130,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *fileTypeLabel = [UILabel new]; fileTypeLabel.text = fileExtension.uppercaseString; - fileTypeLabel.textColor = UIColor.ows_light90Color; + fileTypeLabel.textColor = [UIColor ows_light90Color]; fileTypeLabel.lineBreakMode = NSLineBreakByTruncatingTail; fileTypeLabel.font = [UIFont ows_dynamicTypeCaption1Font].ows_mediumWeight; fileTypeLabel.adjustsFontSizeToFitWidth = YES; @@ -156,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *topLabel = [UILabel new]; self.topLabel = topLabel; topLabel.text = topText; - topLabel.textColor = textColor; + topLabel.textColor = (self.isIncoming ? [UIColor ows_whiteColor] : [UIColor ows_light90Color]); topLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; topLabel.font = [OWSGenericAttachmentView topLabelFont]; [labelsView addArrangedSubview:topLabel]; @@ -169,7 +150,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *bottomLabel = [UILabel new]; self.bottomLabel = bottomLabel; bottomLabel.text = bottomText; - bottomLabel.textColor = [textColor colorWithAlphaComponent:0.85f]; + bottomLabel.textColor = (self.isIncoming ? [UIColor colorWithWhite:1.f alpha:0.7f] : [UIColor ows_light60Color]); bottomLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; bottomLabel.font = [OWSGenericAttachmentView bottomLabelFont]; [labelsView addArrangedSubview:bottomLabel]; From 53c74d84ac49705c8bbd8e15fed8139b18156036 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Jun 2018 15:29:09 -0400 Subject: [PATCH 4/6] Tweak colors. --- .../Cells/OWSAudioMessageView.m | 46 +++++-------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSAudioMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSAudioMessageView.m index 8ed929ed5..406193862 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSAudioMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSAudioMessageView.m @@ -91,28 +91,26 @@ NS_ASSUME_NONNULL_BEGIN } } -- (void)setAudioIcon:(UIImage *)icon iconColor:(UIColor *)iconColor +- (void)setAudioIcon:(UIImage *)icon { OWSAssert(icon.size.height == self.iconSize); icon = [icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; [_audioPlayPauseButton setImage:icon forState:UIControlStateNormal]; [_audioPlayPauseButton setImage:icon forState:UIControlStateDisabled]; - _audioPlayPauseButton.imageView.tintColor = self.bubbleBackgroundColor; - _audioPlayPauseButton.backgroundColor = iconColor; + _audioPlayPauseButton.imageView.tintColor = [UIColor ows_signalBlueColor]; + _audioPlayPauseButton.backgroundColor = [UIColor colorWithWhite:1.f alpha:0.92f]; _audioPlayPauseButton.layer.cornerRadius = self.iconSize * 0.5f; } - (void)setAudioIconToPlay { - [self setAudioIcon:[UIImage imageNamed:@"audio_play_black_40"] - iconColor:(self.isIncoming ? [UIColor colorWithRGBHex:0x9e9e9e] : [self audioColorWithOpacity:0.15f])]; + [self setAudioIcon:[UIImage imageNamed:@"audio_play_black_40"]]; } - (void)setAudioIconToPause { - [self setAudioIcon:[UIImage imageNamed:@"audio_pause_black_40"] - iconColor:(self.isIncoming ? [UIColor colorWithRGBHex:0x9e9e9e] : [self audioColorWithOpacity:0.15f])]; + [self setAudioIcon:[UIImage imageNamed:@"audio_pause_black_40"]]; } - (void)updateAudioProgressView @@ -120,10 +118,9 @@ NS_ASSUME_NONNULL_BEGIN [self.audioProgressView setProgress:(self.audioDurationSeconds > 0 ? self.audioProgressSeconds / self.audioDurationSeconds : 0.f)]; - self.audioProgressView.horizontalBarColor = [self audioColorWithOpacity:0.75f]; - self.audioProgressView.progressColor - = (self.isAudioPlaying ? [self audioColorWithOpacity:self.isIncoming ? 0.2f : 0.1f] - : [self audioColorWithOpacity:0.4f]); + UIColor *progressColor = (self.isIncoming ? [UIColor ows_light02Color] : [UIColor ows_light60Color]); + self.audioProgressView.horizontalBarColor = progressColor; + self.audioProgressView.progressColor = progressColor; } #pragma mark - @@ -172,34 +169,13 @@ NS_ASSUME_NONNULL_BEGIN return [OWSAudioMessageView iconSize]; } -- (UIColor *)audioTextColor -{ - return (self.isIncoming ? [UIColor colorWithWhite:0.2f alpha:1.f] : [UIColor whiteColor]); -} - -- (UIColor *)audioColorWithOpacity:(CGFloat)alpha -{ - return [self.audioTextColor blendWithColor:self.bubbleBackgroundColor alpha:alpha]; -} - -- (UIColor *)bubbleBackgroundColor -{ - return self.isIncoming ? [UIColor ows_messageBubbleLightGrayColor] : [UIColor ows_materialBlueColor]; -} - - (BOOL)isVoiceMessage { - // We want to treat "pre-voice messages flag" messages as voice messages if - // they have no file name. - // - // TODO: Remove this after the flag has been in production for a few months. - return (self.attachmentStream.isVoiceMessage || self.attachmentStream.sourceFilename.length < 1); + return self.attachmentStream.isVoiceMessage; } - (void)createContents { - UIColor *textColor = [self audioTextColor]; - self.axis = UILayoutConstraintAxisHorizontal; self.alignment = UIStackViewAlignmentCenter; self.spacing = self.hSpacing; @@ -225,7 +201,7 @@ NS_ASSUME_NONNULL_BEGIN } UILabel *topLabel = [UILabel new]; topLabel.text = topText; - topLabel.textColor = [textColor colorWithAlphaComponent:0.85f]; + topLabel.textColor = (self.isIncoming ? [UIColor ows_whiteColor] : [UIColor ows_light90Color]); topLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; topLabel.font = [OWSAudioMessageView labelFont]; @@ -237,7 +213,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *bottomLabel = [UILabel new]; self.audioBottomLabel = bottomLabel; [self updateAudioBottomLabel]; - bottomLabel.textColor = [textColor colorWithAlphaComponent:0.85f]; + bottomLabel.textColor = (self.isIncoming ? [UIColor colorWithWhite:1.f alpha:0.7f] : [UIColor ows_light60Color]); bottomLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; bottomLabel.font = [OWSAudioMessageView labelFont]; From 82e649c508b16694566135e12c35d10e9959fe7c Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Jun 2018 15:30:26 -0400 Subject: [PATCH 5/6] Tweak colors. --- Signal/src/views/AttachmentPointerView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/views/AttachmentPointerView.swift b/Signal/src/views/AttachmentPointerView.swift index 75e3abc97..8811e7a3b 100644 --- a/Signal/src/views/AttachmentPointerView.swift +++ b/Signal/src/views/AttachmentPointerView.swift @@ -126,7 +126,7 @@ class AttachmentPointerView: UIStackView { } var textColor: UIColor { - return self.isIncoming ? UIColor.darkText : UIColor.white + return self.isIncoming ? UIColor.ows_white : UIColor.ows_light90 } @objc From 49d34ff0218e23f0bfdfe791dd3b7b21589c4bbe Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Jun 2018 16:16:56 -0400 Subject: [PATCH 6/6] Tweak contact offers. --- .../Cells/OWSContactOffersCell.m | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m index e7af806eb..ae4972bf6 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN self.contentView.layoutMargins = UIEdgeInsetsZero; self.titleLabel = [UILabel new]; - self.titleLabel.textColor = [UIColor blackColor]; + self.titleLabel.textColor = [UIColor ows_light60Color]; self.titleLabel.text = NSLocalizedString(@"CONVERSATION_VIEW_CONTACTS_OFFER_TITLE", @"Title for the group of buttons show for unknown contacts offering to add them to contacts, etc."); self.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; @@ -85,9 +85,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)configureFonts { - self.titleLabel.font = UIFont.ows_dynamicTypeBodyFont.ows_mediumWeight; + self.titleLabel.font = UIFont.ows_dynamicTypeSubheadlineFont; - UIFont *buttonFont = UIFont.ows_dynamicTypeBodyFont; + UIFont *buttonFont = UIFont.ows_dynamicTypeSubheadlineFont.ows_mediumWeight; self.addToContactsButton.titleLabel.font = buttonFont; self.addToProfileWhitelistButton.titleLabel.font = buttonFont; self.blockButton.titleLabel.font = buttonFont; @@ -97,10 +97,10 @@ NS_ASSUME_NONNULL_BEGIN { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setTitle:title forState:UIControlStateNormal]; - [button setTitleColor:[UIColor ows_materialBlueColor] forState:UIControlStateNormal]; + [button setTitleColor:[UIColor ows_signalBlueColor] forState:UIControlStateNormal]; button.titleLabel.textAlignment = NSTextAlignmentCenter; - [button setBackgroundColor:[UIColor colorWithRGBHex:0xf5f5f5]]; - button.layer.cornerRadius = 5.f; + [button setBackgroundColor:[UIColor ows_light02Color]]; + button.layer.cornerRadius = 4.f; [button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside]; return button; } @@ -130,6 +130,10 @@ NS_ASSUME_NONNULL_BEGIN [NSLayoutConstraint deactivateConstraints:self.layoutConstraints]; self.layoutConstraints = @[ + [self.addToContactsButton autoSetDimension:ALDimensionHeight toSize:self.buttonHeight], + [self.addToProfileWhitelistButton autoSetDimension:ALDimensionHeight toSize:self.buttonHeight], + [self.blockButton autoSetDimension:ALDimensionHeight toSize:self.buttonHeight], + [self.stackView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:self.topVMargin], [self.stackView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:self.bottomVMargin], // TODO: Honor "full-width gutters"? @@ -142,27 +146,22 @@ NS_ASSUME_NONNULL_BEGIN - (CGFloat)topVMargin { - return 5.f; + return 0.f; } - (CGFloat)bottomVMargin { - return 5.f; -} - -- (CGFloat)buttonVPadding -{ - return 5.f; + return 0.f; } - (CGFloat)vSpacing { - return 5.f; + return 8.f; } - (CGFloat)buttonHeight { - return (self.buttonVPadding + CGSizeCeil([self.addToContactsButton sizeThatFits:CGSizeZero]).height); + return (24.f + self.addToContactsButton.titleLabel.font.lineHeight); } - (CGSize)cellSizeWithTransaction:(YapDatabaseReadTransaction *)transaction