Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 931562de33
commit a543cd5a4e

@ -40,6 +40,9 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = Theme.backgroundColor;
self.title = NSLocalizedString(@"LINKED_DEVICES_TITLE", @"Menu item and navbar title for the device manager"); self.title = NSLocalizedString(@"LINKED_DEVICES_TITLE", @"Menu item and navbar title for the device manager");
self.isExpectingMoreDevices = NO; self.isExpectingMoreDevices = NO;
@ -301,13 +304,13 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (indexPath.section == OWSLinkedDevicesTableViewControllerSectionAddDevice) { if (indexPath.section == OWSLinkedDevicesTableViewControllerSectionAddDevice) {
UITableViewCell *addNewDeviceCell = UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AddNewDevice" forIndexPath:indexPath];
[tableView dequeueReusableCellWithIdentifier:@"AddNewDevice" forIndexPath:indexPath]; [OWSTableItem configureCell:cell];
addNewDeviceCell.textLabel.text cell.textLabel.text
= NSLocalizedString(@"LINK_NEW_DEVICE_TITLE", @"Navigation title when scanning QR code to add new device."); = NSLocalizedString(@"LINK_NEW_DEVICE_TITLE", @"Navigation title when scanning QR code to add new device.");
addNewDeviceCell.detailTextLabel.text cell.detailTextLabel.text
= NSLocalizedString(@"LINK_NEW_DEVICE_SUBTITLE", @"Subheading for 'Link New Device' navigation"); = NSLocalizedString(@"LINK_NEW_DEVICE_SUBTITLE", @"Subheading for 'Link New Device' navigation");
return addNewDeviceCell; return cell;
} else if (indexPath.section == OWSLinkedDevicesTableViewControllerSectionExistingDevices) { } else if (indexPath.section == OWSLinkedDevicesTableViewControllerSectionExistingDevices) {
OWSDeviceTableViewCell *cell = OWSDeviceTableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:@"ExistingDevice" forIndexPath:indexPath]; [tableView dequeueReusableCellWithIdentifier:@"ExistingDevice" forIndexPath:indexPath];

@ -18,8 +18,9 @@ import SignalServiceKit
// Font config // Font config
nameLabel.font = .ows_dynamicTypeBody nameLabel.font = .ows_dynamicTypeBody
nameLabel.textColor = Theme.primaryColor
subtitleLabel.font = UIFont.ows_regularFont(withSize: 11.0) subtitleLabel.font = UIFont.ows_regularFont(withSize: 11.0)
subtitleLabel.textColor = UIColor.ows_darkGray subtitleLabel.textColor = Theme.secondaryColor
// Layout // Layout
@ -45,6 +46,8 @@ import SignalServiceKit
@objc @objc
public func configure(thread: TSGroupThread, contactsManager: OWSContactsManager) { public func configure(thread: TSGroupThread, contactsManager: OWSContactsManager) {
OWSTableItem.configureCell(self)
if let groupName = thread.groupModel.groupName, !groupName.isEmpty { if let groupName = thread.groupModel.groupName, !groupName.isEmpty {
self.nameLabel.text = groupName self.nameLabel.text = groupName
} else { } else {

@ -1,7 +1,11 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved. //
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSDeviceTableViewCell.h" #import "OWSDeviceTableViewCell.h"
#import "DateUtil.h" #import "DateUtil.h"
#import <SignalMessaging/OWSTableViewController.h>
#import <SignalMessaging/Theme.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -9,6 +13,14 @@ NS_ASSUME_NONNULL_BEGIN
- (void)configureWithDevice:(OWSDevice *)device - (void)configureWithDevice:(OWSDevice *)device
{ {
OWSAssert(device);
[OWSTableItem configureCell:self];
self.nameLabel.textColor = Theme.primaryColor;
self.linkedLabel.textColor = Theme.secondaryColor;
self.lastSeenLabel.textColor = Theme.secondaryColor;
self.nameLabel.text = device.displayName; self.nameLabel.text = device.displayName;
NSString *linkedFormatString NSString *linkedFormatString

@ -111,6 +111,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
cell.contentView.backgroundColor = [Theme backgroundColor]; cell.contentView.backgroundColor = [Theme backgroundColor];
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f]; cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [Theme primaryColor]; cell.textLabel.textColor = [Theme primaryColor];
cell.detailTextLabel.textColor = [Theme secondaryColor];
UIView *selectedBackgroundView = [UIView new]; UIView *selectedBackgroundView = [UIView new];
selectedBackgroundView.backgroundColor = [Theme.cellSelectedColor colorWithAlphaComponent:0.08]; selectedBackgroundView.backgroundColor = [Theme.cellSelectedColor colorWithAlphaComponent:0.08];

@ -109,7 +109,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)conversationButtonBackgroundColor + (UIColor *)conversationButtonBackgroundColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark05Color : UIColor.ows_light02Color); return (Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.3f alpha:1.f] : UIColor.ows_light02Color);
} }
#pragma mark - #pragma mark -

Loading…
Cancel
Save