2017-04-24 17:56:46 +02:00
|
|
|
//
|
2018-06-29 23:28:13 +02:00
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
2017-04-24 17:56:46 +02:00
|
|
|
//
|
|
|
|
|
2014-05-06 19:41:08 +02:00
|
|
|
#import "UIUtil.h"
|
2018-06-29 23:28:13 +02:00
|
|
|
#import "UIColor+OWS.h"
|
2020-11-20 04:04:56 +01:00
|
|
|
#import <SessionUtilitiesKit/AppContext.h>
|
2020-11-11 06:30:54 +01:00
|
|
|
|
2020-11-09 06:03:59 +01:00
|
|
|
#import <SessionUIKit/SessionUIKit.h>
|
2014-05-06 19:41:08 +02:00
|
|
|
|
2014-10-29 21:58:58 +01:00
|
|
|
#define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f
|
2014-05-06 19:41:08 +02:00
|
|
|
|
|
|
|
@implementation UIUtil
|
|
|
|
|
2016-11-18 23:11:56 +01:00
|
|
|
+ (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;
|
2014-05-06 19:41:08 +02:00
|
|
|
}
|
|
|
|
|
2017-12-04 23:17:44 +01:00
|
|
|
+ (void)removeRoundedBorderToImageView:(UIImageView *__strong *)imageView
|
|
|
|
{
|
2014-05-06 19:41:08 +02:00
|
|
|
[[*imageView layer] setBorderWidth:0];
|
|
|
|
[[*imageView layer] setCornerRadius:0];
|
|
|
|
}
|
|
|
|
|
2018-06-30 00:17:49 +02:00
|
|
|
+ (void)setupSignalAppearence
|
2017-12-04 23:17:44 +01:00
|
|
|
{
|
2020-01-17 06:47:52 +01:00
|
|
|
UINavigationBar.appearance.barTintColor = UIColor.whiteColor;
|
|
|
|
UINavigationBar.appearance.translucent = NO;
|
|
|
|
UINavigationBar.appearance.tintColor = UIColor.blackColor;
|
|
|
|
UIToolbar.appearance.barTintColor = UIColor.blackColor;
|
|
|
|
UIToolbar.appearance.translucent = NO;
|
|
|
|
UIToolbar.appearance.tintColor = UIColor.whiteColor;
|
|
|
|
|
|
|
|
UIBarButtonItem.appearance.tintColor = UIColor.blackColor;
|
2020-03-17 06:18:53 +01:00
|
|
|
[UISwitch.appearance setOnTintColor:LKColors.accent];
|
|
|
|
[UIToolbar.appearance setTintColor:LKColors.accent];
|
2018-06-30 00:16:09 +02:00
|
|
|
|
2017-04-24 17:56:46 +02:00
|
|
|
// If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
|
2020-01-17 06:47:52 +01:00
|
|
|
UINavigationBar.appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : UIColor.blackColor };
|
2016-11-15 18:51:55 +01:00
|
|
|
}
|
|
|
|
|
2014-05-06 19:41:08 +02:00
|
|
|
@end
|