Theme review.

pull/1/head
Matthew Chen 7 years ago
parent d62e07d6f1
commit decb0c54ca

@ -27,8 +27,10 @@ NS_ASSUME_NONNULL_BEGIN
self.delegate = self; self.delegate = self;
self.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark95Color : UIColor.ows_light02Color); self.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark85Color : UIColor.ows_light02Color);
self.layer.borderColor = [Theme.primaryColor colorWithAlphaComponent:0.12f].CGColor; self.layer.borderColor
= (Theme.isDarkThemeEnabled ? [Theme.primaryColor colorWithAlphaComponent:0.06f].CGColor
: [Theme.primaryColor colorWithAlphaComponent:0.12f].CGColor);
self.layer.borderWidth = 0.5f; self.layer.borderWidth = 0.5f;
self.scrollIndicatorInsets = UIEdgeInsetsMake(4, 4, 4, 4); self.scrollIndicatorInsets = UIEdgeInsetsMake(4, 4, 4, 4);
@ -48,8 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
self.placeholderView = [UILabel new]; self.placeholderView = [UILabel new];
self.placeholderView.text = NSLocalizedString(@"new_message", @""); self.placeholderView.text = NSLocalizedString(@"new_message", @"");
self.placeholderView.textColor self.placeholderView.textColor = Theme.placeholderColor;
= (Theme.isDarkThemeEnabled ? UIColor.ows_dark55Color : UIColor.ows_light35Color);
self.placeholderView.userInteractionEnabled = NO; self.placeholderView.userInteractionEnabled = NO;
[self addSubview:self.placeholderView]; [self addSubview:self.placeholderView];

@ -93,6 +93,7 @@ const CGFloat kMaxTextViewHeight = 98;
self.backgroundColor = [Theme.toolbarBackgroundColor colorWithAlphaComponent:alpha]; self.backgroundColor = [Theme.toolbarBackgroundColor colorWithAlphaComponent:alpha];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:Theme.barBlurEffect]; UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:Theme.barBlurEffect];
blurEffectView.layer.zPosition = -1;
[self addSubview:blurEffectView]; [self addSubview:blurEffectView];
[blurEffectView autoPinEdgesToSuperviewEdges]; [blurEffectView autoPinEdgesToSuperviewEdges];
} }
@ -379,7 +380,7 @@ const CGFloat kMaxTextViewHeight = 98;
self.voiceMemoUI = [UIView new]; self.voiceMemoUI = [UIView new];
self.voiceMemoUI.userInteractionEnabled = NO; self.voiceMemoUI.userInteractionEnabled = NO;
self.voiceMemoUI.backgroundColor = [UIColor whiteColor]; self.voiceMemoUI.backgroundColor = Theme.toolbarBackgroundColor;
[self addSubview:self.voiceMemoUI]; [self addSubview:self.voiceMemoUI];
self.voiceMemoUI.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); self.voiceMemoUI.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);

@ -3170,7 +3170,7 @@ typedef enum : NSUInteger {
} }
- (void)sendQualityAdjustedAttachmentForVideo:(NSURL *)movieURL - (void)sendQualityAdjustedAttachmentForVideo:(NSURL *)movieURL
filename:(NSString *)filename filename:(nullable NSString *)filename
skipApprovalDialog:(BOOL)skipApprovalDialog skipApprovalDialog:(BOOL)skipApprovalDialog
{ {
OWSAssertIsOnMainThread(); OWSAssertIsOnMainThread();

@ -256,7 +256,7 @@ class ConversationSearchViewController: UITableViewController {
if let messageSnippet = searchResult.snippet { if let messageSnippet = searchResult.snippet {
overrideSnippet = NSAttributedString(string: messageSnippet, overrideSnippet = NSAttributedString(string: messageSnippet,
attributes: [ attributes: [
NSAttributedStringKey.foregroundColor: Theme.primaryColor NSAttributedStringKey.foregroundColor: Theme.secondaryColor
]) ])
} else { } else {
owsFail("\(ConversationSearchViewController.logTag()) message search result is missing message snippet") owsFail("\(ConversationSearchViewController.logTag()) message search result is missing message snippet")
@ -277,6 +277,37 @@ class ConversationSearchViewController: UITableViewController {
return 4 return 4
} }
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
guard let view = self.tableView(tableView, viewForHeaderInSection: section) else {
return 0
}
return view.height()
}
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard let title = self.tableView(tableView, titleForHeaderInSection: section) else {
return nil
}
let label = UILabel()
label.textColor = Theme.secondaryColor
label.text = title
label.font = UIFont.ows_dynamicTypeBody.ows_mediumWeight()
label.tag = section
label.sizeToFit()
let hMargin: CGFloat = 15
let vMargin: CGFloat = 4
let wrapper = UIView()
wrapper.backgroundColor = Theme.offBackgroundColor
wrapper.addSubview(label)
label.autoPinWidthToSuperview(withMargin: hMargin)
label.autoPinHeightToSuperview(withMargin: vMargin)
wrapper.frame = CGRect(x: 0, y: 0, width: label.width() + 2 * hMargin, height: label.height() + 2 * vMargin)
return wrapper
}
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
guard let searchSection = SearchSection(rawValue: section) else { guard let searchSection = SearchSection(rawValue: section) else {
owsFail("unknown section: \(section)") owsFail("unknown section: \(section)")

@ -530,11 +530,15 @@ class CaptioningToolbar: UIView, UITextViewDelegate {
self.backgroundColor = UIColor.clear self.backgroundColor = UIColor.clear
textView.delegate = self textView.delegate = self
textView.backgroundColor = UIColor.white textView.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark85 : UIColor.ows_light02)
textView.layer.borderColor = (Theme.isDarkThemeEnabled
? Theme.primaryColor.withAlphaComponent(0.06).cgColor
: Theme.primaryColor.withAlphaComponent(0.12).cgColor)
textView.layer.borderWidth = 0.5
textView.layer.cornerRadius = kMinTextViewHeight / 2 textView.layer.cornerRadius = kMinTextViewHeight / 2
textView.addBorder(with: UIColor.lightGray)
textView.font = UIFont.ows_dynamicTypeBody textView.font = UIFont.ows_dynamicTypeBody
textView.textColor = Theme.primaryColor
textView.returnKeyType = .done textView.returnKeyType = .done
textView.textContainerInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7) textView.textContainerInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7)
textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3) textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3)

@ -98,7 +98,6 @@ public class OWSNavigationBar: UINavigationBar {
// On iOS11, despite inserting the blur at 0, other views are later inserted into the navbar behind the blur, // On iOS11, despite inserting the blur at 0, other views are later inserted into the navbar behind the blur,
// so we have to set a zindex to avoid obscuring navbar title/buttons. // so we have to set a zindex to avoid obscuring navbar title/buttons.
blurEffectView.layer.zPosition = -1 blurEffectView.layer.zPosition = -1
} }
} }

Loading…
Cancel
Save