WIP navbar

pull/1/head
Michael Kirk 7 years ago
parent e67d03b43f
commit 5d6a988955

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

@ -8,6 +8,13 @@ NS_ASSUME_NONNULL_BEGIN
@interface UIColor (OWS) @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_systemPrimaryButtonColor;
@property (class, readonly, nonatomic) UIColor *ows_signalBrandBlueColor; @property (class, readonly, nonatomic) UIColor *ows_signalBrandBlueColor;
@property (class, readonly, nonatomic) UIColor *ows_materialBlueColor; @property (class, readonly, nonatomic) UIColor *ows_materialBlueColor;

@ -10,6 +10,22 @@ NS_ASSUME_NONNULL_BEGIN
@implementation UIColor (OWS) @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 + (UIColor *)ows_signalBrandBlueColor
{ {
return [UIColor colorWithRed:0.1135657504 green:0.4787300229 blue:0.89595204589999999 alpha:1.]; return [UIColor colorWithRed:0.1135657504 green:0.4787300229 blue:0.89595204589999999 alpha:1.];

@ -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 "UIUtil.h"
#import "UIColor+OWS.h"
#import <SignalServiceKit/AppContext.h> #import <SignalServiceKit/AppContext.h>
#define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f #define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f
@ -34,31 +35,32 @@
+ (void)applyDefaultSystemAppearence + (void)applyDefaultSystemAppearence
{ {
[CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; // [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault];
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; // [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; // [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; // [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setTitleTextAttributes:@{ // [[UINavigationBar appearance] setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor blackColor], // NSForegroundColorAttributeName : [UIColor blackColor],
}]; // }];
} }
+ (void)applySignalAppearence + (void)applySignalAppearence
{ {
[CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; // [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent];
[[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor;
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; // [[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]]; [[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]];
[[UIToolbar appearance] setTintColor:[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. // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
[[UINavigationBar appearance] setTitleTextAttributes:@{ UINavigationBar.appearance.titleTextAttributes = @{
NSForegroundColorAttributeName : [UIColor whiteColor], NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor
}]; };
} }
@end @end

Loading…
Cancel
Save