mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			65 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			65 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Matlab
		
	
| 
								 
											9 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  Copyright (c) 2017 Open Whisper Systems. All rights reserved.
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								#import "UIUtil.h"
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								#import <SignalServiceKit/AppContext.h>
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											11 years ago
										 
									 | 
							
								#define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								@implementation UIUtil
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								+ (void)applyRoundedBorderToImageView:(UIImageView *)imageView
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    imageView.layer.borderWidth = CONTACT_PICTURE_VIEW_BORDER_WIDTH;
							 | 
						||
| 
								 | 
							
								    imageView.layer.borderColor = [UIColor clearColor].CGColor;
							 | 
						||
| 
								 | 
							
								    imageView.layer.cornerRadius = CGRectGetWidth(imageView.frame) / 2;
							 | 
						||
| 
								 | 
							
								    imageView.layer.masksToBounds = YES;
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (void)removeRoundedBorderToImageView:(UIImageView *__strong *)imageView
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								    [[*imageView layer] setBorderWidth:0];
							 | 
						||
| 
								 | 
							
								    [[*imageView layer] setCornerRadius:0];
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (completionBlock)modalCompletionBlock
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 
											11 years ago
										 
									 | 
							
								    completionBlock block = ^void() {
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								        [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent];
							 | 
						||
| 
								 
											11 years ago
										 
									 | 
							
								    };
							 | 
						||
| 
								 
											10 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											11 years ago
										 
									 | 
							
								    return block;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								+ (void)applyDefaultSystemAppearence
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								    [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UINavigationBar appearance] setTitleTextAttributes:@{
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								        NSForegroundColorAttributeName : [UIColor blackColor],
							 | 
						||
| 
								 | 
							
								    }];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								+ (void)applySignalAppearence
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								    [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]];
							 | 
						||
| 
								 | 
							
								    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    [[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]];
							 | 
						||
| 
								 | 
							
								    [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
							 | 
						||
| 
								 | 
							
								    [[UINavigationBar appearance] setTitleTextAttributes:@{
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								        NSForegroundColorAttributeName : [UIColor whiteColor],
							 | 
						||
| 
								 | 
							
								    }];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											12 years ago
										 
									 | 
							
								@end
							 |