more styling to new nav colors

This commit is contained in:
Michael Kirk 2018-06-29 16:16:09 -06:00
parent 001aad0018
commit f8abe32ae9
9 changed files with 23 additions and 20 deletions

View File

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

View File

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

View File

@ -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
// more fine grained control
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.
// It's a static image of the media content.

View File

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

View File

@ -41,7 +41,8 @@ public class OWSNavigationBar: UINavigationBar {
override init(frame: CGRect) {
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(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil)

View File

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

View File

@ -2,8 +2,9 @@
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "UIView+OWS.h"
#import "UIViewController+OWS.h"
#import "UIColor+OWS.h"
#import "UIView+OWS.h"
NS_ASSUME_NONNULL_BEGIN
@ -71,9 +72,10 @@ NS_ASSUME_NONNULL_BEGIN
// in a UIBarButtonItem.
[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);
[backButton setImage:backImage forState:UIControlStateNormal];
backButton.tintColor = UIColor.ows_navbarForegroundColor;
backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;

View File

@ -50,13 +50,17 @@
UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor;
// [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]];
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]];
[[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]];
// [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];
// If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
UINavigationBar.appearance.titleTextAttributes = @{
NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor

View File

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