Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 9fefce94a2
commit ce4fdd5135

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

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

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

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

@ -26,6 +26,7 @@ extern NSString *const ThemeDidChangeNotification;
@property (class, readonly, nonatomic) UIColor *primaryColor; @property (class, readonly, nonatomic) UIColor *primaryColor;
@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;
#pragma mark - Global App Colors #pragma mark - Global App Colors

@ -54,6 +54,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
return (Theme.isDarkThemeEnabled ? UIColor.ows_blackColor : UIColor.ows_whiteColor); 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 + (UIColor *)primaryColor
{ {
// TODO: Theme, Review with design. // TODO: Theme, Review with design.

Loading…
Cancel
Save