WIP navbar

This commit is contained in:
Michael Kirk 2018-06-29 15:28:13 -06:00
parent e67d03b43f
commit 5d6a988955
4 changed files with 43 additions and 17 deletions

View File

@ -412,7 +412,8 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
// UIBarButtonItem in order to ensure that these buttons are spaced tightly.
// The contents of the navigation bar are cramped in this view.
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *image = [UIImage imageNamed:@"button_settings_white"];
UIImage *image = [[UIImage imageNamed:@"button_settings_white"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
button.tintColor = UIColor.ows_navbarForegroundColor;
[button setImage:image forState:UIControlStateNormal];
UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero;
// We normally would want to use left and right insets that ensure the button

View File

@ -8,6 +8,13 @@ NS_ASSUME_NONNULL_BEGIN
@interface UIColor (OWS)
#pragma mark - Global App Colors
@property (class, readonly, nonatomic) UIColor *ows_navbarBackgroundColor;
@property (class, readonly, nonatomic) UIColor *ows_navbarForegroundColor;
#pragma mark -
@property (class, readonly, nonatomic) UIColor *ows_systemPrimaryButtonColor;
@property (class, readonly, nonatomic) UIColor *ows_signalBrandBlueColor;
@property (class, readonly, nonatomic) UIColor *ows_materialBlueColor;

View File

@ -10,6 +10,22 @@ NS_ASSUME_NONNULL_BEGIN
@implementation UIColor (OWS)
#pragma mark - Global App Colors
+ (UIColor *)ows_navbarBackgroundColor
{
return UIColor.ows_whiteColor;
}
+ (UIColor *)ows_navbarForegroundColor
{
// return UIColor.ows_blackColor;
return UIColor.greenColor;
}
#pragma mark -
+ (UIColor *)ows_signalBrandBlueColor
{
return [UIColor colorWithRed:0.1135657504 green:0.4787300229 blue:0.89595204589999999 alpha:1.];

View File

@ -1,8 +1,9 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "UIUtil.h"
#import "UIColor+OWS.h"
#import <SignalServiceKit/AppContext.h>
#define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f
@ -34,31 +35,32 @@
+ (void)applyDefaultSystemAppearence
{
[CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault];
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor blackColor],
}];
// [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault];
// [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
// [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
// [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
// [[UINavigationBar appearance] setTitleTextAttributes:@{
// NSForegroundColorAttributeName : [UIColor blackColor],
// }];
}
+ (void)applySignalAppearence
{
[CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent];
[[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
// [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent];
UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor;
// [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]];
UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor;
[[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]];
// [[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]];
// [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];
// If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
[[UINavigationBar appearance] setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor whiteColor],
}];
UINavigationBar.appearance.titleTextAttributes = @{
NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor
};
}
@end