Refine theme.

This commit is contained in:
Matthew Chen 2018-08-08 11:07:05 -04:00
parent acd7d094b1
commit 5ef0b6d056
13 changed files with 26 additions and 20 deletions

View File

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

View File

@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN
self.circleView = circleView;
circleView.userInteractionEnabled = NO;
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.shadowRadius = 1.5f;
circleView.layer.shadowOpacity = 0.35f;

View File

@ -491,7 +491,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
self.avatarView.image = (self.avatar
?: [[UIImage imageNamed:@"profile_avatar_default"]
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;
}

View File

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

View File

@ -70,7 +70,7 @@ class ContactNameFieldView: UIView {
valueView.text = initialValue
}
valueView.font = UIFont.ows_dynamicTypeBody
valueView.textColor = UIColor.black
valueView.textColor = Theme.primaryColor
stackView.addArrangedSubview(valueView)
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.")
self.view.preservesSuperviewLayoutMargins = false
self.view.backgroundColor = UIColor.white
self.view.backgroundColor = Theme.backgroundColor
updateContent()

View File

@ -74,7 +74,7 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
public override func loadView() {
self.view = UIView.container()
self.view.backgroundColor = UIColor.white
self.view.backgroundColor = Theme.backgroundColor
// Recipient Row
let recipientRow = createRecipientRow()
@ -85,8 +85,8 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
// Text View
textView = UITextView()
textView.delegate = self
textView.backgroundColor = UIColor.white
textView.textColor = UIColor.black
textView.backgroundColor = Theme.backgroundColor
textView.textColor = Theme.primaryColor
textView.font = UIFont.ows_dynamicTypeBody
textView.text = self.initialMessageText
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.
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()
topBorder.backgroundColor = borderColor
@ -128,12 +128,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
let toLabel = UILabel()
toLabel.text = NSLocalizedString("MESSAGE_APPROVAL_RECIPIENT_LABEL",
comment: "Label for the recipient name in the 'message approval' dialog.")
toLabel.textColor = UIColor.ows_darkGray
toLabel.textColor = Theme.secondaryColor
toLabel.font = font
recipientRow.addSubview(toLabel)
let nameLabel = UILabel()
nameLabel.textColor = UIColor.black
nameLabel.textColor = Theme.primaryColor
nameLabel.font = font
nameLabel.lineBreakMode = .byTruncatingTail
recipientRow.addSubview(nameLabel)
@ -165,12 +165,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
}
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 there's a profile name worth showing, add it as a second line below the name.
let profileNameLabel = UILabel()
profileNameLabel.textColor = UIColor.ows_darkGray
profileNameLabel.textColor = Theme.secondaryColor
profileNameLabel.font = font
profileNameLabel.text = profileName
profileNameLabel.lineBreakMode = .byTruncatingTail

View File

@ -71,7 +71,7 @@ public class ModalActivityIndicatorViewController: OWSViewController {
public override func 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
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)

View File

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

View File

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

View File

@ -100,7 +100,7 @@ const CGFloat kContactCellAvatarTextMargin = 12;
self.nameLabel.textColor = [Theme primaryColor];
self.profileNameLabel.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

View File

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

View File

@ -78,6 +78,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
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
+ (UIColor *)navbarBackgroundColor

View File

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