Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 8da96e979c
commit 069c66e5e8

@ -27,8 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
self.delegate = self; self.delegate = self;
self.backgroundColor = [UIColor ows_light02Color]; self.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark95Color : UIColor.ows_light02Color);
self.layer.borderColor = [UIColor.ows_blackColor colorWithAlphaComponent:0.12f].CGColor; self.layer.borderColor = [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);
@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
self.userInteractionEnabled = YES; self.userInteractionEnabled = YES;
self.font = [UIFont ows_dynamicTypeBodyFont]; self.font = [UIFont ows_dynamicTypeBodyFont];
self.textColor = [UIColor blackColor]; self.textColor = Theme.primaryColor;
self.textAlignment = NSTextAlignmentNatural; self.textAlignment = NSTextAlignmentNatural;
self.contentMode = UIViewContentModeRedraw; self.contentMode = UIViewContentModeRedraw;
@ -48,7 +48,8 @@ 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 = UIColor.ows_light35Color; self.placeholderView.textColor
= (Theme.isDarkThemeEnabled ? UIColor.ows_dark55Color : UIColor.ows_light35Color);
self.placeholderView.userInteractionEnabled = NO; self.placeholderView.userInteractionEnabled = NO;
[self addSubview:self.placeholderView]; [self addSubview:self.placeholderView];

@ -1,5 +1,5 @@
// //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
#import "ConversationScrollButton.h" #import "ConversationScrollButton.h"
@ -54,7 +54,6 @@ NS_ASSUME_NONNULL_BEGIN
const CGFloat circleSize = self.class.circleSize; const CGFloat circleSize = self.class.circleSize;
UIView *circleView = [UIView new]; UIView *circleView = [UIView new];
self.circleView = circleView; self.circleView = circleView;
circleView.backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f];
circleView.userInteractionEnabled = NO; circleView.userInteractionEnabled = NO;
circleView.layer.cornerRadius = circleSize * 0.5f; circleView.layer.cornerRadius = circleSize * 0.5f;
circleView.layer.shadowColor = [UIColor colorWithWhite:0.5f alpha:1.f].CGColor; circleView.layer.shadowColor = [UIColor colorWithWhite:0.5f alpha:1.f].CGColor;
@ -81,15 +80,26 @@ NS_ASSUME_NONNULL_BEGIN
- (void)updateColors - (void)updateColors
{ {
UIColor *foregroundColor;
UIColor *backgroundColor;
if (self.hasUnreadMessages) {
foregroundColor = UIColor.whiteColor;
backgroundColor = UIColor.ows_materialBlueColor;
} else if (Theme.isDarkThemeEnabled) {
foregroundColor = UIColor.ows_materialBlueColor;
backgroundColor = [UIColor colorWithWhite:0.25f alpha:1.f];
} else {
foregroundColor = UIColor.ows_materialBlueColor;
backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f];
}
const CGFloat circleSize = self.class.circleSize; const CGFloat circleSize = self.class.circleSize;
self.circleView.backgroundColor self.circleView.backgroundColor = backgroundColor;
= (self.hasUnreadMessages ? [UIColor ows_materialBlueColor] : [UIColor colorWithWhite:0.95f alpha:1.f]); self.iconLabel.attributedText =
self.iconLabel.attributedText = [[NSAttributedString alloc] [[NSAttributedString alloc] initWithString:self.iconText
initWithString:self.iconText
attributes:@{ attributes:@{
NSFontAttributeName : [UIFont ows_fontAwesomeFont:circleSize * 0.8f], NSFontAttributeName : [UIFont ows_fontAwesomeFont:circleSize * 0.8f],
NSForegroundColorAttributeName : NSForegroundColorAttributeName : foregroundColor,
(self.hasUnreadMessages ? [UIColor whiteColor] : [UIColor ows_materialBlueColor]),
NSBaselineOffsetAttributeName : @(-0.5f), NSBaselineOffsetAttributeName : @(-0.5f),
}]; }];
} }

@ -141,8 +141,6 @@ import SignalMessaging
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = UIColor.white
createViews() createViews()
} }
@ -150,6 +148,8 @@ import SignalMessaging
private func createViews() { private func createViews() {
view.backgroundColor = UIColor.black
let contentView = UIView() let contentView = UIView()
contentView.backgroundColor = UIColor.black contentView.backgroundColor = UIColor.black
self.view.addSubview(contentView) self.view.addSubview(contentView)

Loading…
Cancel
Save