Refine theme.

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

@ -130,7 +130,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
// MARK: - Create Views // MARK: - Create Views
private func createViews() { private func createViews() {
view.backgroundColor = UIColor.white view.backgroundColor = Theme.backgroundColor
let scrollView = UIScrollView() let scrollView = UIScrollView()
self.scrollView = scrollView self.scrollView = scrollView
@ -222,7 +222,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
// TODO: It'd be nice to inset these dividers from the edge of the screen. // TODO: It'd be nice to inset these dividers from the edge of the screen.
let addDivider = { let addDivider = {
let divider = UIView() let divider = UIView()
divider.backgroundColor = UIColor(white: 0.9, alpha: 1.0) divider.backgroundColor = Theme.secondaryColor
divider.autoSetDimension(.height, toSize: 0.5) divider.autoSetDimension(.height, toSize: 0.5)
groupRows.append(divider) groupRows.append(divider)
} }
@ -458,7 +458,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
private func nameLabel(text: String) -> UILabel { private func nameLabel(text: String) -> UILabel {
let label = UILabel() let label = UILabel()
label.textColor = UIColor.black label.textColor = Theme.primaryColor
label.font = UIFont.ows_mediumFont(withSize: 14) label.font = UIFont.ows_mediumFont(withSize: 14)
label.text = text label.text = text
label.setContentHuggingHorizontalHigh() label.setContentHuggingHorizontalHigh()
@ -467,7 +467,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
private func valueLabel(text: String) -> UILabel { private func valueLabel(text: String) -> UILabel {
let label = UILabel() let label = UILabel()
label.textColor = UIColor.black label.textColor = Theme.primaryColor
label.font = UIFont.ows_regularFont(withSize: 14) label.font = UIFont.ows_regularFont(withSize: 14)
label.text = text label.text = text
label.setContentHuggingHorizontalLow() label.setContentHuggingHorizontalLow()
@ -488,7 +488,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
if subtitle.count > 0 { if subtitle.count > 0 {
let subtitleLabel = self.valueLabel(text: subtitle) let subtitleLabel = self.valueLabel(text: subtitle)
subtitleLabel.textColor = UIColor.ows_darkGray subtitleLabel.textColor = Theme.secondaryColor
row.addSubview(subtitleLabel) row.addSubview(subtitleLabel)
subtitleLabel.autoPinTrailingToSuperviewMargin() subtitleLabel.autoPinTrailingToSuperviewMargin()
subtitleLabel.autoPinLeading(toTrailingEdgeOf: nameLabel, offset: 10) subtitleLabel.autoPinLeading(toTrailingEdgeOf: nameLabel, offset: 10)

@ -35,7 +35,7 @@ public class OWS2FAReminderViewController: UIViewController, PinEntryViewDelegat
let view = UIView() let view = UIView()
self.view = view self.view = view
view.backgroundColor = .white view.backgroundColor = Theme.backgroundColor
let pinEntryView = PinEntryView() let pinEntryView = PinEntryView()
self.pinEntryView = pinEntryView self.pinEntryView = pinEntryView

@ -89,10 +89,11 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (void)createViews - (void)createViews
{ {
self.view.backgroundColor = [UIColor colorWithRGBHex:0xefeff4]; self.view.backgroundColor
= (Theme.isDarkThemeEnabled ? [UIColor colorWithRGBHex:0x202020] : [UIColor colorWithRGBHex:0xefeff4]);
UIView *contentView = [UIView containerView]; UIView *contentView = [UIView containerView];
contentView.backgroundColor = [UIColor whiteColor]; contentView.backgroundColor = Theme.backgroundColor;
[self.view addSubview:contentView]; [self.view addSubview:contentView];
[contentView autoPinToTopLayoutGuideOfViewController:self withInset:0]; [contentView autoPinToTopLayoutGuideOfViewController:self withInset:0];
[contentView autoPinWidthToSuperview]; [contentView autoPinWidthToSuperview];
@ -111,7 +112,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
UILabel *nameLabel = [UILabel new]; UILabel *nameLabel = [UILabel new];
nameLabel.text = NSLocalizedString( nameLabel.text = NSLocalizedString(
@"PROFILE_VIEW_PROFILE_NAME_FIELD", @"Label for the profile name field of the profile view."); @"PROFILE_VIEW_PROFILE_NAME_FIELD", @"Label for the profile name field of the profile view.");
nameLabel.textColor = [UIColor blackColor]; nameLabel.textColor = Theme.primaryColor;
nameLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints]; nameLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints];
[nameRow addSubview:nameLabel]; [nameRow addSubview:nameLabel];
[nameLabel autoPinLeadingToSuperviewMargin]; [nameLabel autoPinLeadingToSuperviewMargin];
@ -149,7 +150,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
UILabel *avatarLabel = [UILabel new]; UILabel *avatarLabel = [UILabel new];
avatarLabel.text = NSLocalizedString( avatarLabel.text = NSLocalizedString(
@"PROFILE_VIEW_PROFILE_AVATAR_FIELD", @"Label for the profile avatar field of the profile view."); @"PROFILE_VIEW_PROFILE_AVATAR_FIELD", @"Label for the profile avatar field of the profile view.");
avatarLabel.textColor = [UIColor blackColor]; avatarLabel.textColor = Theme.primaryColor;
avatarLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints]; avatarLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints];
[avatarRow addSubview:avatarLabel]; [avatarRow addSubview:avatarLabel];
[avatarLabel autoPinLeadingToSuperviewMargin]; [avatarLabel autoPinLeadingToSuperviewMargin];
@ -183,7 +184,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
[rows addObject:infoRow]; [rows addObject:infoRow];
UILabel *infoLabel = [UILabel new]; UILabel *infoLabel = [UILabel new];
infoLabel.textColor = [UIColor ows_darkGrayColor]; infoLabel.textColor = Theme.secondaryColor;
infoLabel.font = [UIFont ows_regularFontWithSize:11.f]; infoLabel.font = [UIFont ows_regularFontWithSize:11.f];
infoLabel.textAlignment = NSTextAlignmentCenter; infoLabel.textAlignment = NSTextAlignmentCenter;
NSMutableAttributedString *text = [NSMutableAttributedString new]; NSMutableAttributedString *text = [NSMutableAttributedString new];
@ -249,8 +250,7 @@ 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 = [UIColor colorWithWhite:0.9f alpha:1.f]; separator.backgroundColor = Theme.secondaryColor [contentView addSubview:separator];
[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];
@ -356,7 +356,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
} else { } else {
self.saveButton.enabled = NO; self.saveButton.enabled = NO;
[self.saveButton [self.saveButton
setBackgroundColorsWithUpColor:[[UIColor ows_signalBrandBlueColor] blendWithColor:[UIColor whiteColor] setBackgroundColorsWithUpColor:[[UIColor ows_signalBrandBlueColor] blendWithColor:Theme.backgroundColor
alpha:0.5f]]; alpha:0.5f]];
} }
} }

Loading…
Cancel
Save