Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 5ef0b6d056
commit 9c92719ec4

@ -293,8 +293,6 @@ NS_ASSUME_NONNULL_BEGIN
[Theme setIsDarkThemeEnabled:sender.isOn];
[self updateTableContents];
// TODO: Notify and refresh.
}
#endif

@ -42,9 +42,28 @@ NS_ASSUME_NONNULL_BEGIN
navbar.navBarLayoutDelegate = self;
[self updateLayoutForNavbar:navbar];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(themeDidChange:)
name:ThemeDidChangeNotification
object:nil];
return self;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)themeDidChange:(id)notification
{
OWSAssertIsOnMainThread();
self.navigationBar.barTintColor = [UINavigationBar appearance].barTintColor;
self.navigationBar.tintColor = [UINavigationBar appearance].tintColor;
self.navigationBar.titleTextAttributes = [UINavigationBar appearance].titleTextAttributes;
}
- (void)viewDidLoad
{
[super viewDidLoad];

@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
target:self
action:@selector(dismissPressed:)];
self.view.backgroundColor = [UIColor whiteColor];
self.view.backgroundColor = Theme.backgroundColor;
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
_conversationSearcher = ConversationSearcher.shared;
@ -91,7 +91,8 @@ NS_ASSUME_NONNULL_BEGIN
searchBar.searchBarStyle = UISearchBarStyleMinimal;
searchBar.delegate = self;
searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @"");
searchBar.backgroundColor = [UIColor whiteColor];
searchBar.backgroundColor = [Theme backgroundColor];
searchBar.barStyle = Theme.barStyle;
[searchBar sizeToFit];
UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar];

@ -87,7 +87,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
const CGFloat contentVMargin = 0;
UIView *header = [UIView new];
header.backgroundColor = [UIColor whiteColor];
header.backgroundColor = Theme.backgroundColor;
UIButton *cancelShareButton = [UIButton buttonWithType:UIButtonTypeSystem];
[header addSubview:cancelShareButton];

@ -38,7 +38,7 @@ public class AvatarImageView: UIImageView {
}
override public func layoutSubviews() {
self.layer.borderColor = UIColor.black.cgColor.copy(alpha: 0.15)
self.layer.borderColor = UIColor(white: 0, alpha: 0.15).cgColor
self.layer.cornerRadius = self.frame.size.width / 2
}
}

@ -60,7 +60,6 @@ public class DisappearingTimerConfigurationView: UIView {
self.label = UILabel()
label.text = NSString.formatDurationSeconds(durationSeconds, useShortFormat: true)
label.font = UIFont.systemFont(ofSize: 10)
label.textColor = UIColor.white
label.textAlignment = .center
label.minimumScaleFactor = 0.5

@ -71,10 +71,26 @@ public class OWSNavigationBar: UINavigationBar {
NotificationCenter.default.addObserver(self, selector: #selector(callDidChange), name: .OWSWindowManagerCallDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(themeDidChange),
name: .ThemeDidChange,
object: nil)
}
// MARK: Layout
@objc
public func themeDidChange() {
Logger.debug("\(self.logTag) in \(#function)")
guard self.backgroundImage(for: .default) != nil else {
return
}
let color = Theme.navbarBackgroundColor.withAlphaComponent(OWSNavigationBar.backgroundBlurMutingFactor)
let backgroundImage = UIImage(color: color)
self.setBackgroundImage(backgroundImage, for: .default)
}
@objc
public func callDidChange() {
Logger.debug("\(self.logTag) in \(#function)")
@ -143,7 +159,7 @@ public class OWSNavigationBar: UINavigationBar {
@objc
public func makeClear() {
self.backgroundColor = .clear
self.setBackgroundImage(UIImage(), for: .default)
self.setBackgroundImage(nil, for: .default)
self.shadowImage = UIImage()
self.clipsToBounds = true
self.blurEffectView?.isHidden = true

Loading…
Cancel
Save