session-ios/SignalUtilitiesKit/Utilities/UIUtil.m

47 lines
1.5 KiB
Mathematica
Raw Normal View History

//
2018-06-29 23:28:13 +02:00
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
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-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
+ (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
}
+ (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
{
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
// If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored.
2020-01-17 06:47:52 +01:00
UINavigationBar.appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : UIColor.blackColor };
}
2014-05-06 19:41:08 +02:00
@end