more styling to new nav colors

pull/1/head
Michael Kirk 7 years ago
parent 001aad0018
commit f8abe32ae9

@ -64,13 +64,13 @@ public class ConversationHeaderView: UIStackView {
avatarView.layer.borderWidth = 0 avatarView.layer.borderWidth = 0
titleLabel = UILabel() titleLabel = UILabel()
titleLabel.textColor = .white titleLabel.textColor = .ows_navbarForeground
titleLabel.lineBreakMode = .byTruncatingTail titleLabel.lineBreakMode = .byTruncatingTail
titleLabel.font = titlePrimaryFont titleLabel.font = titlePrimaryFont
titleLabel.setContentHuggingHigh() titleLabel.setContentHuggingHigh()
subtitleLabel = UILabel() subtitleLabel = UILabel()
subtitleLabel.textColor = .white subtitleLabel.textColor = .ows_navbarForeground
subtitleLabel.lineBreakMode = .byTruncatingTail subtitleLabel.lineBreakMode = .byTruncatingTail
subtitleLabel.font = subtitleFont subtitleLabel.font = subtitleFont
subtitleLabel.setContentHuggingHigh() subtitleLabel.setContentHuggingHigh()

@ -1379,6 +1379,7 @@ typedef enum : NSUInteger {
{ {
NSMutableAttributedString *subtitleText = [NSMutableAttributedString new]; NSMutableAttributedString *subtitleText = [NSMutableAttributedString new];
UIColor *subtitleColor = [UIColor.ows_navbarForegroundColor colorWithAlphaComponent:(CGFloat)0.9];
if (self.thread.isMuted) { if (self.thread.isMuted) {
// Show a "mute" icon before the navigation bar subtitle if this thread is muted. // Show a "mute" icon before the navigation bar subtitle if this thread is muted.
[subtitleText [subtitleText
@ -1386,7 +1387,7 @@ typedef enum : NSUInteger {
initWithString:@"\ue067 " initWithString:@"\ue067 "
attributes:@{ attributes:@{
NSFontAttributeName : [UIFont ows_elegantIconsFont:7.f], NSFontAttributeName : [UIFont ows_elegantIconsFont:7.f],
NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], NSForegroundColorAttributeName : subtitleColor
}]]; }]];
} }
@ -1405,7 +1406,7 @@ typedef enum : NSUInteger {
initWithString:@"\uf00c " initWithString:@"\uf00c "
attributes:@{ attributes:@{
NSFontAttributeName : [UIFont ows_fontAwesomeFont:10.f], NSFontAttributeName : [UIFont ows_fontAwesomeFont:10.f],
NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], NSForegroundColorAttributeName : subtitleColor,
}]]; }]];
} }
@ -1415,7 +1416,7 @@ typedef enum : NSUInteger {
initWithString:NSLocalizedString(@"GROUP_YOU_LEFT", @"") initWithString:NSLocalizedString(@"GROUP_YOU_LEFT", @"")
attributes:@{ attributes:@{
NSFontAttributeName : self.headerView.subtitleFont, NSFontAttributeName : self.headerView.subtitleFont,
NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], NSForegroundColorAttributeName : subtitleColor,
}]]; }]];
} else { } else {
[subtitleText appendAttributedString: [subtitleText appendAttributedString:
@ -1425,7 +1426,7 @@ typedef enum : NSUInteger {
@"title can be tapped to access settings for this conversation.") @"title can be tapped to access settings for this conversation.")
attributes:@{ attributes:@{
NSFontAttributeName : self.headerView.subtitleFont, NSFontAttributeName : self.headerView.subtitleFont,
NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], NSForegroundColorAttributeName : subtitleColor,
}]]; }]];
} }

@ -248,9 +248,6 @@ class MediaGalleryViewController: OWSNavigationController, MediaGalleryDataSourc
// animate in our view, over the existing context, similar to a cross disolve, but allowing us to have // animate in our view, over the existing context, similar to a cross disolve, but allowing us to have
// more fine grained control // more fine grained control
self.modalPresentationStyle = .custom self.modalPresentationStyle = .custom
self.navigationBar.barTintColor = UIColor.ows_materialBlue
self.navigationBar.isTranslucent = false
self.navigationBar.isOpaque = true
// The presentationView is only used during present/dismiss animations. // The presentationView is only used during present/dismiss animations.
// It's a static image of the media content. // It's a static image of the media content.

@ -174,7 +174,6 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
let footerBar = UIToolbar() let footerBar = UIToolbar()
self.footerBar = footerBar self.footerBar = footerBar
footerBar.barTintColor = UIColor.ows_signalBrandBlue
self.videoPlayBarButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(didPressPlayBarButton)) self.videoPlayBarButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(didPressPlayBarButton))
self.videoPauseBarButton = UIBarButtonItem(barButtonSystemItem: .pause, target: self, action: #selector(didPressPauseBarButton)) self.videoPauseBarButton = UIBarButtonItem(barButtonSystemItem: .pause, target: self, action: #selector(didPressPauseBarButton))
@ -588,7 +587,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
lazy private var headerNameLabel: UILabel = { lazy private var headerNameLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.textColor = .white label.textColor = .ows_navbarForeground
label.font = UIFont.ows_regularFont(withSize: 17) label.font = UIFont.ows_regularFont(withSize: 17)
label.textAlignment = .center label.textAlignment = .center
label.adjustsFontSizeToFitWidth = true label.adjustsFontSizeToFitWidth = true
@ -599,7 +598,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
lazy private var headerDateLabel: UILabel = { lazy private var headerDateLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.textColor = .white label.textColor = .ows_navbarForeground
label.font = UIFont.ows_regularFont(withSize: 12) label.font = UIFont.ows_regularFont(withSize: 12)
label.textAlignment = .center label.textAlignment = .center
label.adjustsFontSizeToFitWidth = true label.adjustsFontSizeToFitWidth = true

@ -41,7 +41,8 @@ public class OWSNavigationBar: UINavigationBar {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
self.isTranslucent = false self.isOpaque = false
self.isTranslucent = true
NotificationCenter.default.addObserver(self, selector: #selector(callDidChange), name: .OWSWindowManagerCallDidChange, object: nil) 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(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil)

@ -70,7 +70,6 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
// Make navigationBar clear // Make navigationBar clear
navController.navigationBar.backgroundColor = .clear navController.navigationBar.backgroundColor = .clear
navController.navigationBar.setBackgroundImage(UIImage(), for: .default) navController.navigationBar.setBackgroundImage(UIImage(), for: .default)
navController.navigationBar.isTranslucent = true
navController.navigationBar.shadowImage = UIImage() navController.navigationBar.shadowImage = UIImage()
navController.navigationBar.clipsToBounds = true navController.navigationBar.clipsToBounds = true

@ -2,8 +2,9 @@
// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
#import "UIView+OWS.h"
#import "UIViewController+OWS.h" #import "UIViewController+OWS.h"
#import "UIColor+OWS.h"
#import "UIView+OWS.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -71,9 +72,10 @@ NS_ASSUME_NONNULL_BEGIN
// in a UIBarButtonItem. // in a UIBarButtonItem.
[backButton addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; [backButton addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
UIImage *backImage = [UIImage imageNamed:(isRTL ? @"NavBarBackRTL" : @"NavBarBack")]; UIImage *backImage = [[UIImage imageNamed:(isRTL ? @"NavBarBackRTL" : @"NavBarBack")] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
OWSAssert(backImage); OWSAssert(backImage);
[backButton setImage:backImage forState:UIControlStateNormal]; [backButton setImage:backImage forState:UIControlStateNormal];
backButton.tintColor = UIColor.ows_navbarForegroundColor;
backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;

@ -50,13 +50,17 @@
UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor;
// [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; // [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]];
UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor; UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor;
UIToolbar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor;
UIToolbar.appearance.tintColor = UIColor.ows_navbarForegroundColor;
// [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]]; UIBarButtonItem.appearance.tintColor = UIColor.ows_navbarForegroundColor;
// [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor
// ows_materialBlueColor]];
[[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]]; [[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]];
[[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]]; [[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]];
// [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];
// If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored. // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
UINavigationBar.appearance.titleTextAttributes = @{ UINavigationBar.appearance.titleTextAttributes = @{
NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor

@ -81,7 +81,7 @@
<string>fontawesome-webfont.ttf</string> <string>fontawesome-webfont.ttf</string>
</array> </array>
<key>UIStatusBarStyle</key> <key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string> <string>UIStatusBarStyleDefault</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>

Loading…
Cancel
Save