Refine theme.

This commit is contained in:
Matthew Chen 2018-08-08 09:47:54 -04:00
parent 9fefce94a2
commit ce4fdd5135
6 changed files with 17 additions and 18 deletions

View File

@ -89,8 +89,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (void)createViews
{
self.view.backgroundColor
= (Theme.isDarkThemeEnabled ? [UIColor colorWithRGBHex:0x202020] : [UIColor colorWithRGBHex:0xefeff4]);
self.view.backgroundColor = Theme.offBackgroundColor;
UIView *contentView = [UIView containerView];
contentView.backgroundColor = Theme.backgroundColor;
@ -250,7 +249,8 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
if (lastRow == nameRow || lastRow == avatarRow) {
UIView *separator = [UIView containerView];
separator.backgroundColor = Theme.secondaryColor [contentView addSubview:separator];
separator.backgroundColor = Theme.secondaryColor;
[contentView addSubview:separator];
[separator autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:lastRow withOffset:5.f];
[separator autoPinLeadingToSuperviewMarginWithInset:18.f];
[separator autoPinTrailingToSuperviewMarginWithInset:18.f];

View File

@ -180,9 +180,7 @@ typedef void (^CustomLayoutBlock)(void);
- (void)createViews
{
UIColor *darkGrey = [UIColor colorWithRGBHex:0x404040];
self.view.backgroundColor = [UIColor whiteColor];
self.view.backgroundColor = Theme.backgroundColor;
// Verify/Unverify Button
UIView *verifyUnverifyButton = [UIView new];
@ -241,7 +239,7 @@ typedef void (^CustomLayoutBlock)(void);
UILabel *instructionsLabel = [UILabel new];
instructionsLabel.text = [NSString stringWithFormat:instructionsFormat, self.contactName];
instructionsLabel.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(11.f, 14.f)];
instructionsLabel.textColor = darkGrey;
instructionsLabel.textColor = Theme.secondaryColor;
instructionsLabel.textAlignment = NSTextAlignmentCenter;
instructionsLabel.numberOfLines = 0;
instructionsLabel.lineBreakMode = NSLineBreakByWordWrapping;
@ -253,7 +251,7 @@ typedef void (^CustomLayoutBlock)(void);
UILabel *fingerprintLabel = [UILabel new];
fingerprintLabel.text = self.fingerprint.displayableText;
fingerprintLabel.font = [UIFont fontWithName:@"Menlo-Regular" size:ScaleFromIPhone5To7Plus(20.f, 23.f)];
fingerprintLabel.textColor = darkGrey;
fingerprintLabel.textColor = Theme.secondaryColor;
fingerprintLabel.numberOfLines = 3;
fingerprintLabel.lineBreakMode = NSLineBreakByTruncatingTail;
fingerprintLabel.adjustsFontSizeToFitWidth = YES;
@ -283,7 +281,7 @@ typedef void (^CustomLayoutBlock)(void);
OWSBezierPathView *fingerprintCircle = [OWSBezierPathView new];
[fingerprintCircle setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) {
layer.fillColor = [UIColor colorWithWhite:0.9f alpha:1.f].CGColor;
layer.fillColor = Theme.offBackgroundColor.CGColor;
CGFloat size = MIN(bounds.size.width, bounds.size.height);
CGRect circle = CGRectMake((bounds.size.width - size) * 0.5f, (bounds.size.height - size) * 0.5f, size, size);
layer.path = [UIBezierPath bezierPathWithOvalInRect:circle].CGPath;
@ -301,7 +299,7 @@ typedef void (^CustomLayoutBlock)(void);
UILabel *scanLabel = [UILabel new];
scanLabel.text = NSLocalizedString(@"PRIVACY_TAP_TO_SCAN", @"Button that shows the 'scan with camera' view.");
scanLabel.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)];
scanLabel.textColor = [UIColor colorWithWhite:0.15f alpha:1.f];
scanLabel.textColor = Theme.secondaryColor;
[scanLabel sizeToFit];
[fingerprintView addSubview:scanLabel];
@ -319,7 +317,7 @@ typedef void (^CustomLayoutBlock)(void);
UILabel *verificationStateLabel = [UILabel new];
self.verificationStateLabel = verificationStateLabel;
verificationStateLabel.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(16.f, 20.f)];
verificationStateLabel.textColor = darkGrey;
verificationStateLabel.textColor = Theme.secondaryColor;
verificationStateLabel.textAlignment = NSTextAlignmentCenter;
verificationStateLabel.numberOfLines = 0;
verificationStateLabel.lineBreakMode = NSLineBreakByWordWrapping;

View File

@ -891,8 +891,6 @@ const CGFloat kIconViewLength = 24;
- (void)showShareProfileAlert
{
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
[OWSProfileManager.sharedManager presentAddThreadToProfileWhitelist:self.thread
fromViewController:self
success:^{
@ -968,8 +966,6 @@ const CGFloat kIconViewLength = 24;
- (void)didTapLeaveGroup
{
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_TITLE", @"Alert title")
message:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_DESCRIPTION", @"Alert body")

View File

@ -67,9 +67,7 @@ class ReminderView: UIView {
self.backgroundColor = UIColor.ows_reminderYellow
case .explanation:
// TODO: Theme, review with design.
self.backgroundColor = (Theme.isDarkThemeEnabled
? UIColor(rgbHex: 0x202020)
: UIColor(rgbHex: 0xf5f5f5))
self.backgroundColor = Theme.offBackgroundColor
}
self.clipsToBounds = true

View File

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

View File

@ -54,6 +54,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
return (Theme.isDarkThemeEnabled ? UIColor.ows_blackColor : UIColor.ows_whiteColor);
}
+ (UIColor *)offBackgroundColor
{
return (
Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.2f alpha:1.f] : [UIColor colorWithWhite:0.9f alpha:1.f]);
}
+ (UIColor *)primaryColor
{
// TODO: Theme, Review with design.