Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent acd7d094b1
commit 5ef0b6d056

@ -291,7 +291,7 @@
AvatarImageView *avatarView = [[AvatarImageView alloc] initWithImage:avatarImage]; AvatarImageView *avatarView = [[AvatarImageView alloc] initWithImage:avatarImage];
if (!localProfileAvatarImage) { if (!localProfileAvatarImage) {
avatarView.tintColor = [UIColor colorWithRGBHex:0x888888]; avatarView.tintColor = Theme.middleGrayColor;
} }
[cell.contentView addSubview:avatarView]; [cell.contentView addSubview:avatarView];
[avatarView autoVCenterInSuperview]; [avatarView autoVCenterInSuperview];

@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN
self.circleView = circleView; self.circleView = circleView;
circleView.userInteractionEnabled = NO; circleView.userInteractionEnabled = NO;
circleView.layer.cornerRadius = circleSize * 0.5f; circleView.layer.cornerRadius = circleSize * 0.5f;
circleView.layer.shadowColor = [UIColor colorWithWhite:0.5f alpha:1.f].CGColor; circleView.layer.shadowColor = Theme.middleGrayColor.CGColor;
circleView.layer.shadowOffset = CGSizeMake(+1.f, +2.f); circleView.layer.shadowOffset = CGSizeMake(+1.f, +2.f);
circleView.layer.shadowRadius = 1.5f; circleView.layer.shadowRadius = 1.5f;
circleView.layer.shadowOpacity = 0.35f; circleView.layer.shadowOpacity = 0.35f;

@ -491,7 +491,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
self.avatarView.image = (self.avatar self.avatarView.image = (self.avatar
?: [[UIImage imageNamed:@"profile_avatar_default"] ?: [[UIImage imageNamed:@"profile_avatar_default"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]); imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]);
self.avatarView.tintColor = (self.avatar ? nil : [UIColor colorWithRGBHex:0x888888]); self.avatarView.tintColor = (self.avatar ? nil : Theme.middleGrayColor);
self.cameraImageView.hidden = self.avatar != nil; self.cameraImageView.hidden = self.avatar != nil;
} }

@ -213,7 +213,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
UILabel *examplePhoneNumberLabel = [UILabel new]; UILabel *examplePhoneNumberLabel = [UILabel new];
self.examplePhoneNumberLabel = examplePhoneNumberLabel; self.examplePhoneNumberLabel = examplePhoneNumberLabel;
examplePhoneNumberLabel.font = [UIFont ows_regularFontWithSize:fontSizePoints - 2.f]; examplePhoneNumberLabel.font = [UIFont ows_regularFontWithSize:fontSizePoints - 2.f];
examplePhoneNumberLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; examplePhoneNumberLabel.textColor = Theme.middleGrayColor;
[contentView addSubview:examplePhoneNumberLabel]; [contentView addSubview:examplePhoneNumberLabel];
[examplePhoneNumberLabel autoPinTrailingToSuperviewMargin]; [examplePhoneNumberLabel autoPinTrailingToSuperviewMargin];
[examplePhoneNumberLabel autoPinEdge:ALEdgeTop [examplePhoneNumberLabel autoPinEdge:ALEdgeTop

@ -70,7 +70,7 @@ class ContactNameFieldView: UIView {
valueView.text = initialValue valueView.text = initialValue
} }
valueView.font = UIFont.ows_dynamicTypeBody valueView.font = UIFont.ows_dynamicTypeBody
valueView.textColor = UIColor.black valueView.textColor = Theme.primaryColor
stackView.addArrangedSubview(valueView) stackView.addArrangedSubview(valueView)
valueView.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) valueView.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged)
@ -209,7 +209,7 @@ public class EditContactShareNameViewController: OWSViewController, ContactNameF
comment: "Title for the 'edit contact share name' view.") comment: "Title for the 'edit contact share name' view.")
self.view.preservesSuperviewLayoutMargins = false self.view.preservesSuperviewLayoutMargins = false
self.view.backgroundColor = UIColor.white self.view.backgroundColor = Theme.backgroundColor
updateContent() updateContent()

@ -74,7 +74,7 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
public override func loadView() { public override func loadView() {
self.view = UIView.container() self.view = UIView.container()
self.view.backgroundColor = UIColor.white self.view.backgroundColor = Theme.backgroundColor
// Recipient Row // Recipient Row
let recipientRow = createRecipientRow() let recipientRow = createRecipientRow()
@ -85,8 +85,8 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
// Text View // Text View
textView = UITextView() textView = UITextView()
textView.delegate = self textView.delegate = self
textView.backgroundColor = UIColor.white textView.backgroundColor = Theme.backgroundColor
textView.textColor = UIColor.black textView.textColor = Theme.primaryColor
textView.font = UIFont.ows_dynamicTypeBody textView.font = UIFont.ows_dynamicTypeBody
textView.text = self.initialMessageText textView.text = self.initialMessageText
textView.contentInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0) textView.contentInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0)
@ -103,7 +103,7 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
// Hairline borders should be 1 pixel, not 1 point. // Hairline borders should be 1 pixel, not 1 point.
let borderThickness = 1.0 / UIScreen.main.scale let borderThickness = 1.0 / UIScreen.main.scale
let borderColor = UIColor(white: 135 / 255.0, alpha: 1.0) let borderColor = Theme.middleGrayColor
let topBorder = UIView.container() let topBorder = UIView.container()
topBorder.backgroundColor = borderColor topBorder.backgroundColor = borderColor
@ -128,12 +128,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
let toLabel = UILabel() let toLabel = UILabel()
toLabel.text = NSLocalizedString("MESSAGE_APPROVAL_RECIPIENT_LABEL", toLabel.text = NSLocalizedString("MESSAGE_APPROVAL_RECIPIENT_LABEL",
comment: "Label for the recipient name in the 'message approval' dialog.") comment: "Label for the recipient name in the 'message approval' dialog.")
toLabel.textColor = UIColor.ows_darkGray toLabel.textColor = Theme.secondaryColor
toLabel.font = font toLabel.font = font
recipientRow.addSubview(toLabel) recipientRow.addSubview(toLabel)
let nameLabel = UILabel() let nameLabel = UILabel()
nameLabel.textColor = UIColor.black nameLabel.textColor = Theme.primaryColor
nameLabel.font = font nameLabel.font = font
nameLabel.lineBreakMode = .byTruncatingTail nameLabel.lineBreakMode = .byTruncatingTail
recipientRow.addSubview(nameLabel) recipientRow.addSubview(nameLabel)
@ -165,12 +165,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
} }
nameLabel.attributedText = contactsManager.formattedFullName(forRecipientId: contactThread.contactIdentifier(), font: font) nameLabel.attributedText = contactsManager.formattedFullName(forRecipientId: contactThread.contactIdentifier(), font: font)
nameLabel.textColor = UIColor.black nameLabel.textColor = Theme.primaryColor
if let profileName = self.profileName(contactThread: contactThread) { if let profileName = self.profileName(contactThread: contactThread) {
// If there's a profile name worth showing, add it as a second line below the name. // If there's a profile name worth showing, add it as a second line below the name.
let profileNameLabel = UILabel() let profileNameLabel = UILabel()
profileNameLabel.textColor = UIColor.ows_darkGray profileNameLabel.textColor = Theme.secondaryColor
profileNameLabel.font = font profileNameLabel.font = font
profileNameLabel.text = profileName profileNameLabel.text = profileName
profileNameLabel.lineBreakMode = .byTruncatingTail profileNameLabel.lineBreakMode = .byTruncatingTail

@ -71,7 +71,7 @@ public class ModalActivityIndicatorViewController: OWSViewController {
public override func loadView() { public override func loadView() {
super.loadView() super.loadView()
self.view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.25) self.view.backgroundColor = UIColor(white: 0, alpha: 0.25)
self.view.isOpaque = false self.view.isOpaque = false
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)

@ -289,7 +289,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
cell.textLabel.font = [UIFont ows_regularFontWithSize:15.f]; cell.textLabel.font = [UIFont ows_regularFontWithSize:15.f];
// Soft color. // Soft color.
// TODO: Theme, review with design. // TODO: Theme, review with design.
cell.textLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; cell.textLabel.textColor = Theme.middleGrayColor;
// Centered. // Centered.
cell.textLabel.textAlignment = NSTextAlignmentCenter; cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.userInteractionEnabled = NO; cell.userInteractionEnabled = NO;

@ -223,8 +223,7 @@ NS_ASSUME_NONNULL_BEGIN
[[DisappearingTimerConfigurationView alloc] [[DisappearingTimerConfigurationView alloc]
initWithDurationSeconds:disappearingMessagesConfiguration.durationSeconds]; initWithDurationSeconds:disappearingMessagesConfiguration.durationSeconds];
disappearingTimerConfigurationView.tintColor = disappearingTimerConfigurationView.tintColor = Theme.middleGrayColor;
[UIColor colorWithWhite:0.5f alpha:1.f];
[disappearingTimerConfigurationView autoSetDimensionsToSize:CGSizeMake(44, 44)]; [disappearingTimerConfigurationView autoSetDimensionsToSize:CGSizeMake(44, 44)];
[cell ows_setAccessoryView:disappearingTimerConfigurationView]; [cell ows_setAccessoryView:disappearingTimerConfigurationView];

@ -100,7 +100,7 @@ const CGFloat kContactCellAvatarTextMargin = 12;
self.nameLabel.textColor = [Theme primaryColor]; self.nameLabel.textColor = [Theme primaryColor];
self.profileNameLabel.textColor = [Theme secondaryColor]; self.profileNameLabel.textColor = [Theme secondaryColor];
self.subtitleLabel.textColor = [Theme secondaryColor]; self.subtitleLabel.textColor = [Theme secondaryColor];
self.accessoryLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; self.accessoryLabel.textColor = Theme.middleGrayColor;
} }
- (void)configureWithRecipientId:(NSString *)recipientId contactsManager:(OWSContactsManager *)contactsManager - (void)configureWithRecipientId:(NSString *)recipientId contactsManager:(OWSContactsManager *)contactsManager

@ -27,6 +27,7 @@ extern NSString *const ThemeDidChangeNotification;
@property (class, readonly, nonatomic) UIColor *secondaryColor; @property (class, readonly, nonatomic) UIColor *secondaryColor;
@property (class, readonly, nonatomic) UIColor *boldColor; @property (class, readonly, nonatomic) UIColor *boldColor;
@property (class, readonly, nonatomic) UIColor *offBackgroundColor; @property (class, readonly, nonatomic) UIColor *offBackgroundColor;
@property (class, readonly, nonatomic) UIColor *middleGrayColor;
#pragma mark - Global App Colors #pragma mark - Global App Colors

@ -78,6 +78,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
return (Theme.isDarkThemeEnabled ? UIColor.ows_whiteColor : UIColor.blackColor); return (Theme.isDarkThemeEnabled ? UIColor.ows_whiteColor : UIColor.blackColor);
} }
+ (UIColor *)middleGrayColor
{
// TODO: Review with design.
return [UIColor colorWithWhite:0.5f alpha:1.f];
}
#pragma mark - Global App Colors #pragma mark - Global App Colors
+ (UIColor *)navbarBackgroundColor + (UIColor *)navbarBackgroundColor

@ -255,6 +255,6 @@ public class ConversationStyle: NSObject {
@objc @objc
public func quotedReplyAttachmentColor() -> UIColor { public func quotedReplyAttachmentColor() -> UIColor {
// TODO: // TODO:
return UIColor(white: 0.5, alpha: 1.0) return Theme.middleGrayColor
} }
} }

Loading…
Cancel
Save