Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 4f8dbf39b5
commit 8da96e979c

@ -5,6 +5,7 @@
#import "DomainFrontingCountryViewController.h" #import "DomainFrontingCountryViewController.h"
#import "OWSCountryMetadata.h" #import "OWSCountryMetadata.h"
#import "OWSTableViewController.h" #import "OWSTableViewController.h"
#import "UIColor+OWS.h"
#import "UIFont+OWS.h" #import "UIFont+OWS.h"
#import "UIView+OWS.h" #import "UIView+OWS.h"
#import <SignalServiceKit/OWSSignalService.h> #import <SignalServiceKit/OWSSignalService.h>
@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
self.title = NSLocalizedString( self.title = NSLocalizedString(
@"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE", @"Title for the 'censorship circumvention country' view."); @"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE", @"Title for the 'censorship circumvention country' view.");
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = Theme.backgroundColor;
[self createViews]; [self createViews];
} }
@ -63,9 +64,8 @@ NS_ASSUME_NONNULL_BEGIN
[section addItem:[OWSTableItem [section addItem:[OWSTableItem
itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
UITableViewCell *cell = [OWSTableItem newCell]; UITableViewCell *cell = [OWSTableItem newCell];
[OWSTableItem configureCell:cell];
cell.textLabel.text = countryMetadata.localizedCountryName; cell.textLabel.text = countryMetadata.localizedCountryName;
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [UIColor blackColor];
if ([countryMetadata.countryCode isEqualToString:currentCountryCode]) { if ([countryMetadata.countryCode isEqualToString:currentCountryCode]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark; cell.accessoryType = UITableViewCellAccessoryCheckmark;

@ -189,8 +189,9 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
override func loadView() { override func loadView() {
self.view = UIView() self.view = UIView()
self.view.backgroundColor = UIColor.black
self.view.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20) self.view.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20)
createViews() createViews()
createViewConstraints() createViewConstraints()
} }

@ -172,7 +172,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
// This view provides a background "below the fold". // This view provides a background "below the fold".
let bottomView = UIView.container() let bottomView = UIView.container()
bottomView.backgroundColor = UIColor.white bottomView.backgroundColor = Theme.backgroundColor
self.view.addSubview(bottomView) self.view.addSubview(bottomView)
bottomView.layoutMargins = .zero bottomView.layoutMargins = .zero
bottomView.autoPinWidthToSuperview() bottomView.autoPinWidthToSuperview()
@ -197,7 +197,9 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
} }
private func heroBackgroundColor() -> UIColor { private func heroBackgroundColor() -> UIColor {
return UIColor(rgbHex: 0xefeff4) return (Theme.isDarkThemeEnabled()
? UIColor(rgbHex: 0x272727)
: UIColor(rgbHex: 0xefeff4))
} }
private func createTopView() -> UIView { private func createTopView() -> UIView {
@ -226,7 +228,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
} }
let backIconView = UIImageView(image: backIconImage.withRenderingMode(.alwaysTemplate)) let backIconView = UIImageView(image: backIconImage.withRenderingMode(.alwaysTemplate))
backIconView.contentMode = .scaleAspectFit backIconView.contentMode = .scaleAspectFit
backIconView.tintColor = UIColor.black.withAlphaComponent(0.6) backIconView.tintColor = Theme.primaryColor.withAlphaComponent(0.6)
backButton.addSubview(backIconView) backButton.addSubview(backIconView)
backIconView.autoCenterInSuperview() backIconView.autoCenterInSuperview()
@ -242,7 +244,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
let nameLabel = UILabel() let nameLabel = UILabel()
nameLabel.text = contactShare.displayName nameLabel.text = contactShare.displayName
nameLabel.font = UIFont.ows_dynamicTypeTitle1 nameLabel.font = UIFont.ows_dynamicTypeTitle1
nameLabel.textColor = UIColor.black nameLabel.textColor = Theme.primaryColor
nameLabel.lineBreakMode = .byTruncatingTail nameLabel.lineBreakMode = .byTruncatingTail
nameLabel.textAlignment = .center nameLabel.textAlignment = .center
topView.addSubview(nameLabel) topView.addSubview(nameLabel)
@ -256,7 +258,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
let phoneNumberLabel = UILabel() let phoneNumberLabel = UILabel()
phoneNumberLabel.text = PhoneNumber.bestEffortLocalizedPhoneNumber(withE164: phoneNumber) phoneNumberLabel.text = PhoneNumber.bestEffortLocalizedPhoneNumber(withE164: phoneNumber)
phoneNumberLabel.font = UIFont.ows_dynamicTypeFootnote phoneNumberLabel.font = UIFont.ows_dynamicTypeFootnote
phoneNumberLabel.textColor = UIColor.black phoneNumberLabel.textColor = Theme.primaryColor
phoneNumberLabel.lineBreakMode = .byTruncatingTail phoneNumberLabel.lineBreakMode = .byTruncatingTail
phoneNumberLabel.textAlignment = .center phoneNumberLabel.textAlignment = .center
topView.addSubview(phoneNumberLabel) topView.addSubview(phoneNumberLabel)
@ -427,7 +429,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
button.autoSetDimension(.width, toSize: buttonSize, relation: .greaterThanOrEqual) button.autoSetDimension(.width, toSize: buttonSize, relation: .greaterThanOrEqual)
let circleView = UIView() let circleView = UIView()
circleView.backgroundColor = UIColor.white circleView.backgroundColor = Theme.backgroundColor
circleView.autoSetDimension(.width, toSize: buttonSize) circleView.autoSetDimension(.width, toSize: buttonSize)
circleView.autoSetDimension(.height, toSize: buttonSize) circleView.autoSetDimension(.height, toSize: buttonSize)
circleView.layer.cornerRadius = buttonSize * 0.5 circleView.layer.cornerRadius = buttonSize * 0.5
@ -439,14 +441,15 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
owsFail("\(logTag) missing image.") owsFail("\(logTag) missing image.")
return button return button
} }
let imageView = UIImageView(image: image) let imageView = UIImageView(image: image.withRenderingMode(.alwaysTemplate))
imageView.tintColor = Theme.primaryColor.withAlphaComponent(0.6)
circleView.addSubview(imageView) circleView.addSubview(imageView)
imageView.autoCenterInSuperview() imageView.autoCenterInSuperview()
let label = UILabel() let label = UILabel()
label.text = text label.text = text
label.font = UIFont.ows_dynamicTypeCaption2 label.font = UIFont.ows_dynamicTypeCaption2
label.textColor = UIColor.black label.textColor = Theme.primaryColor
label.lineBreakMode = .byTruncatingTail label.lineBreakMode = .byTruncatingTail
label.textAlignment = .center label.textAlignment = .center
button.addSubview(label) button.addSubview(label)
@ -460,7 +463,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
private func createLargePillButton(text: String, actionBlock : @escaping () -> Void) -> UIView { private func createLargePillButton(text: String, actionBlock : @escaping () -> Void) -> UIView {
let button = TappableView(actionBlock: actionBlock) let button = TappableView(actionBlock: actionBlock)
button.backgroundColor = UIColor.white button.backgroundColor = Theme.backgroundColor
button.layoutMargins = .zero button.layoutMargins = .zero
button.autoSetDimension(.height, toSize: 45) button.autoSetDimension(.height, toSize: 45)
button.layer.cornerRadius = 5 button.layer.cornerRadius = 5

@ -106,7 +106,6 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
self.searchBar = searchBar self.searchBar = searchBar
searchBar.searchBarStyle = .minimal searchBar.searchBarStyle = .minimal
searchBar.delegate = self searchBar.delegate = self
searchBar.backgroundColor = .white
searchBar.sizeToFit() searchBar.sizeToFit()
tableView.tableHeaderView = searchBar tableView.tableHeaderView = searchBar

Loading…
Cancel
Save