зеркало из https://github.com/nextcloud/talk-ios.git
Drop iOS 12 support
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Родитель
30c1ce970f
Коммит
ef8b0115a8
|
@ -6,6 +6,11 @@ opt_in_rules: # some rules are turned off by default, so you need to opt-in
|
|||
- file_types_order
|
||||
- unneeded_parentheses_in_closure_argument
|
||||
|
||||
disabled_rules:
|
||||
- type_body_length
|
||||
- file_length
|
||||
- function_body_length
|
||||
|
||||
empty_count:
|
||||
severity: warning
|
||||
|
||||
|
@ -13,10 +18,6 @@ line_length:
|
|||
# warning: 120
|
||||
warning: 200
|
||||
|
||||
type_body_length:
|
||||
# error: 350
|
||||
error: 500
|
||||
|
||||
identifier_name:
|
||||
min_length: 0
|
||||
|
||||
|
|
|
@ -2147,7 +2147,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -2200,7 +2200,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
|
@ -2237,7 +2237,7 @@
|
|||
"\"$(PROJECT_DIR)/ThirdParty\"/**",
|
||||
);
|
||||
INFOPLIST_FILE = NextcloudTalk/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -2285,7 +2285,7 @@
|
|||
"\"$(PROJECT_DIR)/ThirdParty\"/**",
|
||||
);
|
||||
INFOPLIST_FILE = NextcloudTalk/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -2356,7 +2356,7 @@
|
|||
"\"$(PROJECT_DIR)/ThirdParty\"/**",
|
||||
);
|
||||
INFOPLIST_FILE = ShareExtension/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -2449,7 +2449,7 @@
|
|||
"\"$(PROJECT_DIR)/ThirdParty\"/**",
|
||||
);
|
||||
INFOPLIST_FILE = ShareExtension/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -2539,7 +2539,7 @@
|
|||
"\"$(PROJECT_DIR)/ThirdParty\"/**",
|
||||
);
|
||||
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -2614,7 +2614,7 @@
|
|||
"\"$(PROJECT_DIR)/ThirdParty\"/**",
|
||||
);
|
||||
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
_searchController.searchResultsUpdater = self;
|
||||
[_searchController.searchBar sizeToFit];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -110,16 +109,6 @@
|
|||
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
|
||||
[clearButton setTintColor:[NCAppBranding themeTextColor]];
|
||||
});
|
||||
} else {
|
||||
self.navigationItem.searchController = _searchController;
|
||||
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
|
||||
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
|
||||
searchTextField.tintColor = [NCAppBranding themeColor];
|
||||
UIView *backgroundview = [searchTextField.subviews firstObject];
|
||||
backgroundview.backgroundColor = [NCAppBranding backgroundColor];
|
||||
backgroundview.layer.cornerRadius = 8;
|
||||
backgroundview.clipsToBounds = YES;
|
||||
}
|
||||
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
// Contacts placeholder view
|
||||
|
|
|
@ -114,10 +114,8 @@
|
|||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
[self scheduleAppRefresh];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||
|
@ -306,19 +304,15 @@
|
|||
- (void)registerBackgroundFetchTask {
|
||||
NSString *refreshTaskIdentifier = [NSString stringWithFormat:@"%@.refresh", NSBundle.mainBundle.bundleIdentifier];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
// see: https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler?language=objc
|
||||
[[BGTaskScheduler sharedScheduler] registerForTaskWithIdentifier:refreshTaskIdentifier
|
||||
usingQueue:nil
|
||||
launchHandler:^(__kindof BGTask * _Nonnull task) {
|
||||
[self handleAppRefresh:task];
|
||||
}];
|
||||
} else {
|
||||
[UIApplication.sharedApplication setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)scheduleAppRefresh API_AVAILABLE(ios(13.0))
|
||||
- (void)scheduleAppRefresh
|
||||
{
|
||||
NSString *refreshTaskIdentifier = [NSString stringWithFormat:@"%@.refresh", NSBundle.mainBundle.bundleIdentifier];
|
||||
|
||||
|
@ -333,7 +327,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)handleAppRefresh:(BGTask *)task API_AVAILABLE(ios(13.0))
|
||||
- (void)handleAppRefresh:(BGTask *)task
|
||||
{
|
||||
[NCUtils log:@"Performing background fetch -> handleAppRefresh"];
|
||||
|
||||
|
@ -345,6 +339,8 @@
|
|||
}];
|
||||
}
|
||||
|
||||
// This method is called when you simulate a background fetch from the debug menu in XCode
|
||||
// so we keep it around, although it's deprecated on iOS 13 onwards
|
||||
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
||||
{
|
||||
[NCUtils log:@"Performing background fetch -> performFetchWithCompletionHandler"];
|
||||
|
|
|
@ -49,10 +49,8 @@ NSString * const kNCAuthTokenFlowEndpoint = @"/index.php/login/flo
|
|||
self = [super init];
|
||||
if (self) {
|
||||
self.serverUrl = serverUrl;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.modalPresentationStyle = ([[NCDatabaseManager sharedInstance] numberOfAccounts] == 0) ? UIModalPresentationFullScreen : UIModalPresentationAutomatic;
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -136,14 +136,9 @@
|
|||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[titleLabel]|" options:0 metrics:metrics views:views]];
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-32-[userStatusImageView(12)]-(>=0)-|" options:0 metrics:metrics views:views]];
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-32-[userStatusImageView(12)]-(>=0)-|" options:0 metrics:metrics views:views]];
|
||||
self.backgroundColor = [UIColor groupTableViewBackgroundColor];
|
||||
self.titleLabel.textColor = [UIColor darkTextColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
self.titleLabel.textColor = [UIColor labelColor];
|
||||
}
|
||||
}
|
||||
|
||||
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-right-[avatarView(avatarSize)]-(>=0)-|" options:0 metrics:metrics views:views]];
|
||||
}
|
||||
|
@ -214,13 +209,9 @@
|
|||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.userInteractionEnabled = NO;
|
||||
_titleLabel.numberOfLines = 1;
|
||||
_titleLabel.textColor = [UIColor lightGrayColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:[ChatMessageTableViewCell defaultFontSize]];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_titleLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
@ -233,13 +224,9 @@
|
|||
_dateLabel.backgroundColor = [UIColor clearColor];
|
||||
_dateLabel.userInteractionEnabled = NO;
|
||||
_dateLabel.numberOfLines = 1;
|
||||
_dateLabel.textColor = [UIColor lightGrayColor];
|
||||
_dateLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_dateLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _dateLabel;
|
||||
}
|
||||
|
||||
|
@ -338,11 +325,8 @@
|
|||
|
||||
if (message.isDeletedMessage) {
|
||||
self.statusView.hidden = YES;
|
||||
self.bodyTextView.textColor = [UIColor colorWithWhite:0 alpha:0.3];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.bodyTextView.textColor = [UIColor tertiaryLabelColor];
|
||||
}
|
||||
}
|
||||
|
||||
[self.reactionsView updateReactionsWithReactions:message.reactionsArray];
|
||||
if (message.reactionsArray.count > 0) {
|
||||
|
|
|
@ -65,11 +65,7 @@ CGFloat const kContactsTableCellTitleFontSize = 17.0f;
|
|||
self.userStatusMessageLabel.hidden = YES;
|
||||
|
||||
self.labelTitle.text = @"";
|
||||
self.labelTitle.textColor = [UIColor darkTextColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.labelTitle.textColor = [UIColor labelColor];
|
||||
}
|
||||
|
||||
self.labelTitle.font = [UIFont systemFontOfSize:kContactsTableCellTitleFontSize weight:UIFontWeightRegular];
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
self.tabBarController.tabBar.tintColor = [NCAppBranding themeColor];
|
||||
self.navigationController.navigationBar.translucent = NO;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -64,7 +63,6 @@
|
|||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
self.navigationController.title = self.title;
|
||||
|
||||
|
|
|
@ -135,7 +135,6 @@ class DiagnosticsTableViewController: UITableViewController {
|
|||
self.navigationController?.navigationBar.tintColor = NCAppBranding.themeTextColor()
|
||||
self.navigationController?.navigationBar.barTintColor = NCAppBranding.themeColor()
|
||||
self.tabBarController?.tabBar.tintColor = NCAppBranding.themeColor()
|
||||
if #available(iOS 13.0, *) {
|
||||
let themeColor: UIColor = NCAppBranding.themeColor()
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
|
@ -144,7 +143,6 @@ class DiagnosticsTableViewController: UITableViewController {
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifierOpenAppSettings)
|
||||
self.tableView.register(SubtitleTableViewCell.self, forCellReuseIdentifier: cellIdentifierSubtitle)
|
||||
|
|
|
@ -91,7 +91,6 @@
|
|||
self.tabBarController.tabBar.tintColor = [NCAppBranding themeColor];
|
||||
self.navigationController.navigationBar.translucent = NO;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -100,7 +99,6 @@
|
|||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
self.tableView.separatorInset = UIEdgeInsetsMake(0, 64, 0, 0);
|
||||
|
||||
|
|
|
@ -200,10 +200,7 @@
|
|||
placeholderImage:filePreviewImage success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
|
||||
|
||||
//TODO: How to adjust for dark mode?
|
||||
weakSelf.previewImageView.layer.borderColor = [[UIColor colorWithWhite:0.9 alpha:1.0] CGColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
weakSelf.previewImageView.layer.borderColor = [[UIColor secondarySystemFillColor] CGColor];
|
||||
}
|
||||
weakSelf.previewImageView.layer.borderWidth = 1.0f;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||
|
@ -385,13 +382,9 @@
|
|||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.userInteractionEnabled = NO;
|
||||
_titleLabel.numberOfLines = 1;
|
||||
_titleLabel.textColor = [UIColor lightGrayColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:[FileMessageTableViewCell defaultFontSize]];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_titleLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
@ -404,13 +397,9 @@
|
|||
_dateLabel.backgroundColor = [UIColor clearColor];
|
||||
_dateLabel.userInteractionEnabled = NO;
|
||||
_dateLabel.numberOfLines = 1;
|
||||
_dateLabel.textColor = [UIColor lightGrayColor];
|
||||
_dateLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_dateLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _dateLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,11 +113,8 @@
|
|||
|
||||
if (message.isDeletedMessage) {
|
||||
self.statusView.hidden = YES;
|
||||
self.bodyTextView.textColor = [UIColor colorWithWhite:0 alpha:0.3];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.bodyTextView.textColor = [UIColor tertiaryLabelColor];
|
||||
}
|
||||
}
|
||||
[self.reactionsView updateReactionsWithReactions:message.reactionsArray];
|
||||
if (message.reactionsArray.count > 0) {
|
||||
_vConstraint[3].constant = 40;
|
||||
|
|
|
@ -37,10 +37,7 @@
|
|||
if (self) {
|
||||
[[NSBundle mainBundle] loadNibNamed:@"HeaderWithButton" owner:self options:nil];
|
||||
|
||||
_label.textColor = [UIColor darkGrayColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_label.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
|
||||
[self addSubview:self.contentView];
|
||||
|
||||
|
|
|
@ -292,13 +292,9 @@
|
|||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.userInteractionEnabled = NO;
|
||||
_titleLabel.numberOfLines = 1;
|
||||
_titleLabel.textColor = [UIColor lightGrayColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:[LocationMessageTableViewCell defaultFontSize]];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_titleLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
@ -311,13 +307,9 @@
|
|||
_dateLabel.backgroundColor = [UIColor clearColor];
|
||||
_dateLabel.userInteractionEnabled = NO;
|
||||
_dateLabel.numberOfLines = 1;
|
||||
_dateLabel.textColor = [UIColor lightGrayColor];
|
||||
_dateLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_dateLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _dateLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
self.navigationController.navigationBar.translucent = NO;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -58,7 +57,6 @@
|
|||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
_locationManager = [[CLLocationManager alloc] init];
|
||||
_locationManager.delegate = self;
|
||||
|
|
|
@ -29,11 +29,7 @@
|
|||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self) {
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
}
|
||||
|
||||
[self configureSubviews];
|
||||
}
|
||||
|
@ -72,14 +68,10 @@
|
|||
_separatorLabel.backgroundColor = [UIColor clearColor];
|
||||
_separatorLabel.userInteractionEnabled = NO;
|
||||
_separatorLabel.numberOfLines = 1;
|
||||
_separatorLabel.textColor = [UIColor lightGrayColor];
|
||||
_separatorLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
_separatorLabel.text = NSLocalizedString(@"Unread messages", nil);
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_separatorLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _separatorLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,14 +111,12 @@ BOOL const useServerThemimg = YES;
|
|||
TalkAccount *activeAccount = [[NCDatabaseManager sharedInstance] activeAccount];
|
||||
ServerCapabilities *serverCapabilities = [[NCDatabaseManager sharedInstance] serverCapabilitiesForAccountId:activeAccount.accountId];
|
||||
if (serverCapabilities) {
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *elementColorBright = [NCUtils colorFromHexString:serverCapabilities.colorElementBright];
|
||||
UIColor *elementColorDark = [NCUtils colorFromHexString:serverCapabilities.colorElementDark];
|
||||
|
||||
if (elementColorBright && elementColorDark) {
|
||||
return [self getDynamicColor:elementColorBright withDarkMode:elementColorDark];
|
||||
}
|
||||
}
|
||||
|
||||
UIColor *color = [NCUtils colorFromHexString:serverCapabilities.colorElement];
|
||||
if (color) {
|
||||
|
@ -130,7 +128,7 @@ BOOL const useServerThemimg = YES;
|
|||
return elementColor;
|
||||
}
|
||||
|
||||
+ (UIColor *)getDynamicColor:(UIColor *)lightModeColor withDarkMode:(UIColor *)darkModeColor API_AVAILABLE(ios(13.0))
|
||||
+ (UIColor *)getDynamicColor:(UIColor *)lightModeColor withDarkMode:(UIColor *)darkModeColor
|
||||
{
|
||||
return [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traits) {
|
||||
if (traits.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
|
@ -156,44 +154,28 @@ BOOL const useServerThemimg = YES;
|
|||
|
||||
+ (UIColor *)placeholderColor
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
return [UIColor placeholderTextColor];
|
||||
}
|
||||
|
||||
return [UIColor colorWithRed: 0.84 green: 0.84 blue: 0.84 alpha: 1.00]; // #d5d5d5
|
||||
}
|
||||
|
||||
+ (UIColor *)backgroundColor
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
return [UIColor systemBackgroundColor];
|
||||
}
|
||||
|
||||
return [UIColor whiteColor];
|
||||
}
|
||||
|
||||
+ (UIColor *)avatarPlaceholderColor
|
||||
{
|
||||
// We will only use avatarPlaceholderColor for avatars that are on top theme/custom color.
|
||||
// For avatars that are on top of default background color (light or dark), we will use placeholderColor.
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *light = [UIColor colorWithRed: 0.7 green: 0.7 blue: 0.7 alpha: 1.00];
|
||||
UIColor *dark = [UIColor colorWithRed: 0.35 green: 0.35 blue: 0.35 alpha: 1.00];
|
||||
return [self getDynamicColor:light withDarkMode:dark];
|
||||
}
|
||||
|
||||
return [UIColor colorWithRed: 0.84 green: 0.84 blue: 0.84 alpha: 1.00]; // #d5d5d5
|
||||
}
|
||||
|
||||
+ (UIColor *)chatForegroundColor
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
return [self getDynamicColor:[UIColor darkGrayColor] withDarkMode:[UIColor labelColor]];
|
||||
}
|
||||
|
||||
return [UIColor darkGrayColor];
|
||||
}
|
||||
|
||||
+ (UIStatusBarStyle)statusBarStyleForBrandColor
|
||||
{
|
||||
return [self statusBarStyleForTextColorStyle:[self brandTextColorStyle]];
|
||||
|
@ -210,20 +192,11 @@ BOOL const useServerThemimg = YES;
|
|||
|
||||
+ (UIStatusBarStyle)statusBarStyleForTextColorStyle:(NCTextColorStyle)style
|
||||
{
|
||||
switch (style) {
|
||||
case NCTextColorStyleDark:
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
if (style == NCTextColorStyleDark) {
|
||||
return UIStatusBarStyleDarkContent;
|
||||
}
|
||||
return UIStatusBarStyleDefault;
|
||||
}
|
||||
break;
|
||||
case NCTextColorStyleLight:
|
||||
default:
|
||||
|
||||
return UIStatusBarStyleLightContent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NCTextColorStyle)brandTextColorStyle
|
||||
|
|
|
@ -448,13 +448,8 @@ NSString * const kSharedItemTypeVoice = @"voice";
|
|||
{
|
||||
NSMutableAttributedString *message = [self parsedMessage];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
//TODO: Further adjust for dark-mode ?
|
||||
[message addAttribute:NSForegroundColorAttributeName value:[UIColor tertiaryLabelColor] range:NSMakeRange(0,message.length)];
|
||||
} else {
|
||||
[message addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithWhite:0 alpha:0.3] range:NSMakeRange(0,message.length)];
|
||||
}
|
||||
|
||||
|
||||
return message;
|
||||
}
|
||||
|
|
|
@ -257,7 +257,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
self.tabBarController.tabBar.tintColor = [NCAppBranding themeColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -273,7 +272,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
[self.textInputbar.editorTitle setTextColor:[UIColor labelColor]];
|
||||
[self.textView.layer setBorderWidth:1.0];
|
||||
[self.textView.layer setBorderColor:[UIColor systemGray4Color].CGColor];
|
||||
}
|
||||
|
||||
// Hide default top border of UIToolbar
|
||||
[self.textInputbar setShadowImage:[UIImage new] forToolbarPosition:UIBarPositionAny];
|
||||
|
@ -283,12 +281,7 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
[self.inputbarBorderView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin];
|
||||
self.inputbarBorderView.frame = CGRectMake(0, 0, self.textInputbar.frame.size.width, 1);
|
||||
self.inputbarBorderView.hidden = YES;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.inputbarBorderView.backgroundColor = [UIColor systemGray6Color];
|
||||
} else {
|
||||
self.inputbarBorderView.backgroundColor = [NCAppBranding placeholderColor];
|
||||
}
|
||||
|
||||
[self.textInputbar addSubview:self.inputbarBorderView];
|
||||
|
||||
|
@ -297,11 +290,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
_emojiTextField.delegate = self;
|
||||
[self.view addSubview:_emojiTextField];
|
||||
|
||||
// Add long press gesture recognizer for messages
|
||||
UILongPressGestureRecognizer *longPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
longPressGesture.delegate = self;
|
||||
[self.tableView addGestureRecognizer:longPressGesture];
|
||||
|
||||
// Add long press gesture recognizer for voice message recording button
|
||||
self.voiceMessageLongPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressInVoiceMessageRecordButton:)];
|
||||
self.voiceMessageLongPressGesture.delegate = self;
|
||||
|
@ -324,10 +312,8 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
[self.tableView registerClass:[MessageSeparatorTableViewCell class] forCellReuseIdentifier:MessageSeparatorCellIdentifier];
|
||||
[self.autoCompletionView registerClass:[ChatMessageTableViewCell class] forCellReuseIdentifier:AutoCompletionCellIdentifier];
|
||||
[self registerPrefixesForAutoCompletion:@[@"@"]];
|
||||
self.autoCompletionView.backgroundColor = [UIColor groupTableViewBackgroundColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.autoCompletionView.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
}
|
||||
|
||||
if (@available(iOS 15.0, *)) {
|
||||
self.autoCompletionView.sectionHeaderTopPadding = 0;
|
||||
}
|
||||
|
@ -566,7 +552,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
|
||||
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
if ([self.traitCollection hasDifferentColorAppearanceComparedToTraitCollection:previousTraitCollection]) {
|
||||
// We use a CGColor so we loose the automatic color changing of dynamic colors -> update manually
|
||||
[self.textView.layer setBorderColor:[UIColor systemGray4Color].CGColor];
|
||||
|
@ -574,7 +559,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
[self updateToolbar:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Keyboard notifications
|
||||
|
||||
|
@ -850,16 +834,12 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
|
||||
UILabel *footerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 350, 24)];
|
||||
footerLabel.textAlignment = NSTextAlignmentCenter;
|
||||
footerLabel.textColor = [UIColor lightGrayColor];
|
||||
footerLabel.textColor = [UIColor secondaryLabelColor];
|
||||
footerLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
footerLabel.backgroundColor = [UIColor clearColor];
|
||||
footerLabel.text = NSLocalizedString(@"Offline, only showing downloaded messages", nil);
|
||||
self.tableView.tableFooterView = footerLabel;
|
||||
self.tableView.tableFooterView.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
footerLabel.textColor = [UIColor secondaryLabelColor];
|
||||
self.tableView.tableFooterView.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
}
|
||||
|
||||
if (isAtBottom) {
|
||||
[self.tableView slk_scrollToBottomAnimated:YES];
|
||||
|
@ -1403,11 +1383,7 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
|
||||
- (void)presentPollCreation
|
||||
{
|
||||
UITableViewStyle style = UITableViewStyleGrouped;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
style = UITableViewStyleInsetGrouped;
|
||||
}
|
||||
PollCreationViewController *pollCreationVC = [[PollCreationViewController alloc] initWithStyle:style];
|
||||
PollCreationViewController *pollCreationVC = [[PollCreationViewController alloc] initWithStyle:UITableViewStyleInsetGrouped];
|
||||
pollCreationVC.pollCreationDelegate = self;
|
||||
NCNavigationController *pollCreationNC = [[NCNavigationController alloc] initWithRootViewController:pollCreationVC];
|
||||
[self presentViewController:pollCreationNC animated:YES completion:nil];
|
||||
|
@ -2191,172 +2167,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
appDelegate.shouldLockInterfaceOrientation = lock;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - iOS <=12 message long press menu
|
||||
|
||||
- (void)handleLongPress:(UILongPressGestureRecognizer *)gestureRecognizer
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
// Use native contextmenus on iOS >= 13
|
||||
return;
|
||||
}
|
||||
|
||||
CGPoint point = [gestureRecognizer locationInView:self.tableView];
|
||||
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:point];
|
||||
if (indexPath != nil && gestureRecognizer.state == UIGestureRecognizerStateBegan) {
|
||||
NSDate *sectionDate = [_dateSections objectAtIndex:indexPath.section];
|
||||
NCChatMessage *message = [[_messages objectForKey:sectionDate] objectAtIndex:indexPath.row];
|
||||
if (!message.isSystemMessage) {
|
||||
|
||||
// Do not show menu if long pressing in reactions view
|
||||
ChatTableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
|
||||
CGPoint pointInCell = [self.tableView convertPoint:point toView:cell];
|
||||
for (UIView *subview in cell.contentView.subviews) {
|
||||
if ([subview isKindOfClass:ReactionsView.class] && CGRectContainsPoint(subview.frame, pointInCell)) {
|
||||
[self showReactionsSummaryOfMessage:cell.message];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Select cell
|
||||
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
|
||||
|
||||
// Create menu
|
||||
FTPopOverMenuConfiguration *menuConfiguration = [[FTPopOverMenuConfiguration alloc] init];
|
||||
menuConfiguration.menuIconMargin = 12;
|
||||
menuConfiguration.menuTextMargin = 12;
|
||||
menuConfiguration.imageSize = CGSizeMake(20, 20);
|
||||
menuConfiguration.separatorInset = UIEdgeInsetsMake(0, 44, 0, 0);
|
||||
menuConfiguration.menuRowHeight = 44;
|
||||
menuConfiguration.autoMenuWidth = YES;
|
||||
menuConfiguration.textFont = [UIFont systemFontOfSize:15];
|
||||
menuConfiguration.backgroundColor = [UIColor colorWithWhite:0.3 alpha:1];
|
||||
menuConfiguration.borderWidth = 0;
|
||||
menuConfiguration.shadowOpacity = 0;
|
||||
menuConfiguration.roundedImage = NO;
|
||||
menuConfiguration.defaultSelection = YES;
|
||||
|
||||
BOOL hasChatPermission = ![[NCDatabaseManager sharedInstance] serverHasTalkCapability:kCapabilityChatPermission] || (_room.permissions & NCPermissionChat) != 0;
|
||||
|
||||
NSMutableArray *menuArray = [NSMutableArray new];
|
||||
// Reply option
|
||||
if ([self isMessageReplyable:message] && hasChatPermission) {
|
||||
NSDictionary *replyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionReply) forKey:@"action"];
|
||||
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Reply", nil) image:[[UIImage imageNamed:@"reply"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:replyInfo];
|
||||
[menuArray addObject:replyModel];
|
||||
}
|
||||
|
||||
// Add reaction option
|
||||
if ([self isMessageReactable:message] && hasChatPermission) {
|
||||
NSDictionary *reactionInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionAddReaction) forKey:@"action"];
|
||||
FTPopOverMenuModel *reactionModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Add reaction", nil) image:[[UIImage imageNamed:@"emoji"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:reactionInfo];
|
||||
[menuArray addObject:reactionModel];
|
||||
}
|
||||
|
||||
// Reply-privately option (only to other users and not in one-to-one)
|
||||
TalkAccount *activeAccount = [[NCDatabaseManager sharedInstance] activeAccount];
|
||||
if ([self isMessageReplyable:message] && _room.type != kNCRoomTypeOneToOne && [message.actorType isEqualToString:@"users"] && ![message.actorId isEqualToString:activeAccount.userId])
|
||||
{
|
||||
NSDictionary *replyPrivatInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionReplyPrivately) forKey:@"action"];
|
||||
FTPopOverMenuModel *replyPrivatModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Reply privately", nil) image:[[UIImage imageNamed:@"user"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:replyPrivatInfo];
|
||||
[menuArray addObject:replyPrivatModel];
|
||||
}
|
||||
|
||||
// Forward option (only normal messages for now)
|
||||
if (!message.file && !message.isDeletedMessage && !_offlineMode) {
|
||||
NSDictionary *forwardInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionForward) forKey:@"action"];
|
||||
FTPopOverMenuModel *forwardModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Forward", nil) image:[[UIImage imageNamed:@"forward"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:forwardInfo];
|
||||
[menuArray addObject:forwardModel];
|
||||
}
|
||||
|
||||
// Re-send option
|
||||
if (message.sendingFailed && !_offlineMode && hasChatPermission) {
|
||||
NSDictionary *replyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionResend) forKey:@"action"];
|
||||
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Resend", nil) image:[[UIImage imageNamed:@"refresh"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:replyInfo];
|
||||
[menuArray addObject:replyModel];
|
||||
}
|
||||
|
||||
// Copy option
|
||||
NSDictionary *copyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionCopy) forKey:@"action"];
|
||||
FTPopOverMenuModel *copyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Copy", nil) image:[[UIImage imageNamed:@"copy"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:copyInfo];
|
||||
[menuArray addObject:copyModel];
|
||||
|
||||
// Open in nextcloud option
|
||||
if (message.file && !_offlineMode) {
|
||||
NSDictionary *openInNextcloudInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionOpenFileInNextcloud) forKey:@"action"];
|
||||
NSString *openInNextcloudTitle = [NSString stringWithFormat:NSLocalizedString(@"Open in %@", nil), filesAppName];
|
||||
FTPopOverMenuModel *openInNextcloudModel = [[FTPopOverMenuModel alloc] initWithTitle:openInNextcloudTitle image:[[UIImage imageNamed:@"logo-action"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:openInNextcloudInfo];
|
||||
[menuArray addObject:openInNextcloudModel];
|
||||
}
|
||||
|
||||
// Delete option
|
||||
if (message.sendingFailed || ([message isDeletableForAccount:[[NCDatabaseManager sharedInstance] activeAccount] andParticipantType:_room.participantType] && hasChatPermission)) {
|
||||
NSDictionary *replyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionDelete) forKey:@"action"];
|
||||
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Delete", nil) image:[[UIImage imageNamed:@"delete"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] userInfo:replyInfo];
|
||||
[menuArray addObject:replyModel];
|
||||
}
|
||||
|
||||
CGRect frame = [self.tableView rectForRowAtIndexPath:indexPath];
|
||||
CGPoint yOffset = self.tableView.contentOffset;
|
||||
CGRect cellRect = CGRectMake(frame.origin.x, (frame.origin.y - yOffset.y), frame.size.width, frame.size.height);
|
||||
|
||||
__weak NCChatViewController *weakSelf = self;
|
||||
[FTPopOverMenu showFromSenderFrame:cellRect withMenuArray:menuArray imageArray:nil configuration:menuConfiguration doneBlock:^(NSInteger selectedIndex) {
|
||||
[weakSelf.tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
FTPopOverMenuModel *model = [menuArray objectAtIndex:selectedIndex];
|
||||
NCChatMessageAction action = (NCChatMessageAction)[[model.userInfo objectForKey:@"action"] integerValue];
|
||||
switch (action) {
|
||||
case kNCChatMessageActionReply:
|
||||
{
|
||||
[weakSelf didPressReply:message];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionReplyPrivately:
|
||||
{
|
||||
[weakSelf didPressReplyPrivately:message];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionAddReaction:
|
||||
{
|
||||
[weakSelf didPressAddReaction:message atIndexPath:indexPath];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionForward:
|
||||
{
|
||||
[weakSelf didPressForward:message];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionCopy:
|
||||
{
|
||||
[weakSelf didPressCopy:message];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionResend:
|
||||
{
|
||||
[weakSelf didPressResend:message];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionOpenFileInNextcloud:
|
||||
{
|
||||
[weakSelf didPressOpenInNextcloud:message];
|
||||
}
|
||||
break;
|
||||
case kNCChatMessageActionDelete:
|
||||
{
|
||||
[weakSelf didPressDelete:message];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} dismissBlock:^{
|
||||
[weakSelf.tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate Methods
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
|
@ -3335,11 +3145,7 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
// Actuate `Peek` feedback (weak boom)
|
||||
AudioServicesPlaySystemSound(1519);
|
||||
|
||||
UITableViewStyle style = UITableViewStyleGrouped;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
style = UITableViewStyleInsetGrouped;
|
||||
}
|
||||
ReactionsSummaryView *reactionsVC = [[ReactionsSummaryView alloc] initWithStyle:style];
|
||||
ReactionsSummaryView *reactionsVC = [[ReactionsSummaryView alloc] initWithStyle:UITableViewStyleInsetGrouped];
|
||||
NCNavigationController *reactionsNC = [[NCNavigationController alloc] initWithRootViewController:reactionsVC];
|
||||
[self presentViewController:reactionsNC animated:YES completion:nil];
|
||||
|
||||
|
@ -3708,7 +3514,7 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
return isReactable;
|
||||
}
|
||||
|
||||
- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point API_AVAILABLE(ios(13.0))
|
||||
- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point
|
||||
{
|
||||
if ([tableView isEqual:self.autoCompletionView]) {
|
||||
return nil;
|
||||
|
@ -3966,11 +3772,7 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
|
||||
- (void)cellWantsToOpenPoll:(NCMessageParameter *)poll
|
||||
{
|
||||
UITableViewStyle style = UITableViewStyleGrouped;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
style = UITableViewStyleInsetGrouped;
|
||||
}
|
||||
PollVotingView *pollVC = [[PollVotingView alloc] initWithStyle:style];
|
||||
PollVotingView *pollVC = [[PollVotingView alloc] initWithStyle:UITableViewStyleInsetGrouped];
|
||||
pollVC.room = _room;
|
||||
NCNavigationController *pollNC = [[NCNavigationController alloc] initWithRootViewController:pollVC];
|
||||
[self presentViewController:pollNC animated:YES completion:nil];
|
||||
|
@ -4063,7 +3865,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
preview.navigationController.navigationBar.barTintColor = themeColor;
|
||||
preview.tabBarController.tabBar.tintColor = themeColor;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
appearance.backgroundColor = themeColor;
|
||||
|
@ -4071,7 +3872,6 @@ NSString * const NCChatViewControllerTalkToUserNotification = @"NCChatViewContro
|
|||
preview.navigationItem.standardAppearance = appearance;
|
||||
preview.navigationItem.compactAppearance = appearance;
|
||||
preview.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
[self presentViewController:preview animated:YES completion:nil];
|
||||
});
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
self.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
self.navigationBar.translucent = NO;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
appearance.backgroundColor = [NCAppBranding themeColor];
|
||||
|
@ -51,7 +50,6 @@
|
|||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
|
|
|
@ -101,16 +101,12 @@
|
|||
if (forceDomain && domain) {
|
||||
_authViewController = [[AuthenticationViewController alloc] initWithServerUrl:domain];
|
||||
_authViewController.delegate = self;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_authViewController.modalPresentationStyle = ([[NCDatabaseManager sharedInstance] numberOfAccounts] == 0) ? UIModalPresentationFullScreen : UIModalPresentationAutomatic;
|
||||
}
|
||||
[_mainNavigationController presentViewController:_authViewController animated:YES completion:nil];
|
||||
} else {
|
||||
_loginViewController = [[LoginViewController alloc] init];
|
||||
_loginViewController.delegate = self;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_loginViewController.modalPresentationStyle = ([[NCDatabaseManager sharedInstance] numberOfAccounts] == 0) ? UIModalPresentationFullScreen : UIModalPresentationAutomatic;
|
||||
}
|
||||
[_mainNavigationController presentViewController:_loginViewController animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,6 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
|
|||
_searchController.searchResultsUpdater = self;
|
||||
[_searchController.searchBar sizeToFit];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -124,16 +123,6 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
|
|||
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
|
||||
[clearButton setTintColor:[NCAppBranding themeTextColor]];
|
||||
});
|
||||
} else {
|
||||
self.navigationItem.searchController = _searchController;
|
||||
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
|
||||
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
|
||||
searchTextField.tintColor = [NCAppBranding themeColor];
|
||||
UIView *backgroundview = [searchTextField.subviews firstObject];
|
||||
backgroundview.backgroundColor = [NCAppBranding backgroundColor];
|
||||
backgroundview.layer.cornerRadius = 8;
|
||||
backgroundview.clipsToBounds = YES;
|
||||
}
|
||||
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
|
||||
|
|
|
@ -188,11 +188,8 @@
|
|||
|
||||
if (message.poll) {
|
||||
[self.objectTypeImageView setImage:[[UIImage imageNamed:@"poll"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
|
||||
[self.objectTypeImageView setTintColor:[UIColor darkTextColor]];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
[self.objectTypeImageView setTintColor:[UIColor labelColor]];
|
||||
}
|
||||
}
|
||||
|
||||
[self.reactionsView updateReactionsWithReactions:message.reactionsArray];
|
||||
if (message.reactionsArray.count > 0) {
|
||||
|
@ -268,13 +265,9 @@
|
|||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.userInteractionEnabled = NO;
|
||||
_titleLabel.numberOfLines = 1;
|
||||
_titleLabel.textColor = [UIColor lightGrayColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:[ObjectShareMessageTableViewCell defaultFontSize]];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_titleLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
@ -287,13 +280,9 @@
|
|||
_dateLabel.backgroundColor = [UIColor clearColor];
|
||||
_dateLabel.userInteractionEnabled = NO;
|
||||
_dateLabel.numberOfLines = 1;
|
||||
_dateLabel.textColor = [UIColor lightGrayColor];
|
||||
_dateLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_dateLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _dateLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,6 @@ import UIKit
|
|||
self.navigationController?.navigationBar.isTranslucent = false
|
||||
self.navigationItem.title = NSLocalizedString("New poll", comment: "")
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
|
||||
|
@ -76,7 +75,6 @@ import UIKit
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
self.tableView.isEditing = true
|
||||
|
||||
|
|
|
@ -49,11 +49,8 @@ import UIKit
|
|||
|
||||
init(poll: NCPoll) {
|
||||
self.poll = poll
|
||||
var style = UITableView.Style.grouped
|
||||
if #available(iOS 13, *) {
|
||||
style = UITableView.Style.insetGrouped
|
||||
}
|
||||
super.init(style: style)
|
||||
|
||||
super.init(style: .insetGrouped)
|
||||
self.setupPollResultsDetailsView()
|
||||
}
|
||||
|
||||
|
@ -66,7 +63,6 @@ import UIKit
|
|||
self.navigationController?.navigationBar.isTranslucent = false
|
||||
self.navigationItem.title = NSLocalizedString("Poll results", comment: "")
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
|
||||
|
@ -75,7 +71,6 @@ import UIKit
|
|||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
}
|
||||
|
||||
func cancelButtonPressed() {
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
|
|
|
@ -62,7 +62,6 @@ import UIKit
|
|||
self.navigationController?.navigationBar.isTranslucent = false
|
||||
self.navigationItem.title = NSLocalizedString("Poll", comment: "")
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
|
||||
|
@ -70,7 +69,6 @@ import UIKit
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
pollBackgroundView.placeholderView.isHidden = true
|
||||
pollBackgroundView.loadingView.startAnimating()
|
||||
|
@ -258,10 +256,8 @@ import UIKit
|
|||
cell.textLabel?.lineBreakMode = .byWordWrapping
|
||||
cell.textLabel?.sizeToFit()
|
||||
cell.imageView?.image = UIImage(named: "poll")?.withRenderingMode(.alwaysTemplate)
|
||||
cell.imageView?.tintColor = UIColor.darkText
|
||||
if #available(iOS 13.0, *) {
|
||||
cell.imageView?.tintColor = UIColor.label
|
||||
}
|
||||
|
||||
case PollSection.kPollSectionOptions.rawValue:
|
||||
if !showPollResults || showIntermediateResults {
|
||||
cell = UITableViewCell(style: .value1, reuseIdentifier: pollOptionCellIdentifier)
|
||||
|
|
|
@ -41,11 +41,7 @@
|
|||
|
||||
- (void)configureSubviews
|
||||
{
|
||||
self.backgroundColor = [UIColor colorWithRed:247.0/255.0 green:247.0/255.0 blue:247.0/255.0 alpha:1.0]; //Default toolbar color
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
}
|
||||
|
||||
[self addSubview:self.quoteView];
|
||||
[self addSubview:self.actorLabel];
|
||||
|
@ -70,11 +66,8 @@
|
|||
if (!_quoteView) {
|
||||
_quoteView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 4, 50)];
|
||||
_quoteView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
_quoteView.backgroundColor = [UIColor lightGrayColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_quoteView.backgroundColor = [UIColor systemFillColor];
|
||||
}
|
||||
}
|
||||
return _quoteView;
|
||||
}
|
||||
|
||||
|
@ -89,12 +82,8 @@
|
|||
_actorLabel.contentMode = UIViewContentModeLeft;
|
||||
|
||||
_actorLabel.font = [UIFont systemFontOfSize:14.0];
|
||||
_actorLabel.textColor = [UIColor lightGrayColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_actorLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _actorLabel;
|
||||
}
|
||||
|
||||
|
@ -109,12 +98,8 @@
|
|||
_messageLabel.contentMode = UIViewContentModeLeft;
|
||||
|
||||
_messageLabel.font = [UIFont systemFontOfSize:14.0];
|
||||
_messageLabel.textColor = [UIColor darkGrayColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_messageLabel.textColor = [NCAppBranding chatForegroundColor];
|
||||
}
|
||||
}
|
||||
return _messageLabel;
|
||||
}
|
||||
|
||||
|
@ -127,12 +112,9 @@
|
|||
if (_highlighted) {
|
||||
_quoteView.backgroundColor = [NCAppBranding themeColor];
|
||||
} else {
|
||||
_quoteView.backgroundColor = [UIColor lightGrayColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_quoteView.backgroundColor = [UIColor systemFillColor];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -46,7 +46,6 @@ import UIKit
|
|||
self.navigationController?.navigationBar.isTranslucent = false
|
||||
self.navigationItem.title = NSLocalizedString("Reactions", comment: "")
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
|
||||
|
@ -54,7 +53,6 @@ import UIKit
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
reactionsBackgroundView.placeholderView.isHidden = true
|
||||
reactionsBackgroundView.loadingView.startAnimating()
|
||||
|
|
|
@ -42,11 +42,8 @@ import UIKit
|
|||
}
|
||||
|
||||
func borderColor() -> CGColor {
|
||||
if #available(iOS 13.0, *) {
|
||||
return UIColor.tertiaryLabel.cgColor
|
||||
}
|
||||
return UIColor.lightGray.cgColor
|
||||
}
|
||||
|
||||
func sizeForReaction(reaction: NCChatReaction) -> CGSize {
|
||||
let text = textForReaction(reaction: reaction)
|
||||
|
|
|
@ -47,11 +47,7 @@
|
|||
|
||||
- (void)configureSubviews
|
||||
{
|
||||
self.backgroundColor = [UIColor colorWithRed:247.0/255.0 green:247.0/255.0 blue:247.0/255.0 alpha:1.0]; //Default toolbar color
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
}
|
||||
|
||||
[self addSubview:self.quoteContainerView];
|
||||
[self addSubview:self.cancelButton];
|
||||
|
@ -87,13 +83,11 @@
|
|||
|
||||
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
if (_topBorder && [self.traitCollection hasDifferentColorAppearanceComparedToTraitCollection:previousTraitCollection]) {
|
||||
// We use a CGColor so we loose the automatic color changing of dynamic colors -> update manually
|
||||
_topBorder.backgroundColor = [UIColor systemGray4Color].CGColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - SLKTypingIndicatorProtocol
|
||||
|
@ -144,12 +138,8 @@
|
|||
if (!_topBorder) {
|
||||
_topBorder = [CAGradientLayer layer];
|
||||
_topBorder.frame = CGRectMake(0.0, 0.0, CGRectGetWidth(SLKKeyWindowBounds()), 0.5);
|
||||
_topBorder.backgroundColor = [UIColor lightGrayColor].CGColor;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_topBorder.backgroundColor = [UIColor systemGray4Color].CGColor;
|
||||
}
|
||||
}
|
||||
return _topBorder;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
|
|||
self.navigationController.navigationBar.translucent = NO;
|
||||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -97,7 +96,6 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
|
|||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
_passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(180, 10, 115, 30)];
|
||||
_passwordTextField.textAlignment = NSTextAlignmentRight;
|
||||
|
|
|
@ -77,7 +77,6 @@
|
|||
_searchController.searchResultsUpdater = self;
|
||||
[_searchController.searchBar sizeToFit];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -108,16 +107,6 @@
|
|||
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
|
||||
[clearButton setTintColor:[NCAppBranding themeTextColor]];
|
||||
});
|
||||
} else {
|
||||
self.navigationItem.searchController = _searchController;
|
||||
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
|
||||
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
|
||||
searchTextField.tintColor = [NCAppBranding themeColor];
|
||||
UIView *backgroundview = [searchTextField.subviews firstObject];
|
||||
backgroundview.backgroundColor = [NCAppBranding backgroundColor];
|
||||
backgroundview.layer.cornerRadius = 8;
|
||||
backgroundview.clipsToBounds = YES;
|
||||
}
|
||||
|
||||
// We want ourselves to be the delegate for the result table so didSelectRowAtIndexPath is called for both tables.
|
||||
_resultTableViewController.tableView.delegate = self;
|
||||
|
|
|
@ -182,7 +182,6 @@ typedef enum FileAction {
|
|||
self.navigationController.navigationBar.translucent = NO;
|
||||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -191,7 +190,6 @@ typedef enum FileAction {
|
|||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
_roomParticipants = [[NSMutableArray alloc] init];
|
||||
|
||||
|
@ -2402,7 +2400,6 @@ typedef enum FileAction {
|
|||
preview.navigationController.navigationBar.barTintColor = themeColor;
|
||||
preview.tabBarController.tabBar.tintColor = themeColor;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
appearance.backgroundColor = themeColor;
|
||||
|
@ -2410,7 +2407,6 @@ typedef enum FileAction {
|
|||
preview.navigationItem.standardAppearance = appearance;
|
||||
preview.navigationItem.compactAppearance = appearance;
|
||||
preview.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
[self.navigationController pushViewController:preview animated:YES];
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ import QuickLook
|
|||
self.navigationController?.navigationBar.isTranslucent = false
|
||||
self.navigationItem.title = NSLocalizedString("Shared items", comment: "")
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
|
||||
|
@ -61,7 +60,6 @@ import QuickLook
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
self.tableView.separatorInset = UIEdgeInsets(top: 0, left: 64, bottom: 0, right: 0)
|
||||
self.tableView.register(UINib(nibName: kDirectoryTableCellNibName, bundle: nil), forCellReuseIdentifier: kDirectoryCellIdentifier)
|
||||
|
|
|
@ -173,7 +173,6 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
|
|||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
self.tabBarController.tabBar.tintColor = [NCAppBranding themeColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -203,16 +202,6 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
|
|||
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
|
||||
[clearButton setTintColor:[NCAppBranding themeTextColor]];
|
||||
});
|
||||
} else {
|
||||
self.navigationItem.searchController = _searchController;
|
||||
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
|
||||
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
|
||||
searchTextField.tintColor = [NCAppBranding themeColor];
|
||||
UIView *backgroundview = [searchTextField.subviews firstObject];
|
||||
backgroundview.backgroundColor = [NCAppBranding backgroundColor];
|
||||
backgroundview.layer.cornerRadius = 8;
|
||||
backgroundview.clipsToBounds = YES;
|
||||
}
|
||||
|
||||
[self setNeedsStatusBarAppearanceUpdate];
|
||||
}
|
||||
|
@ -414,12 +403,8 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
|
|||
menuConfiguration.borderColor = [NCAppBranding placeholderColor];
|
||||
menuConfiguration.backgroundColor = [NCAppBranding backgroundColor];
|
||||
menuConfiguration.separatorColor = [NCAppBranding placeholderColor];
|
||||
menuConfiguration.textColor = [UIColor darkTextColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
menuConfiguration.textColor = [UIColor labelColor];
|
||||
menuConfiguration.shadowColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
|
||||
[FTPopOverMenu showForSender:sender
|
||||
withMenuArray:menuArray
|
||||
|
|
|
@ -131,10 +131,7 @@
|
|||
_numberColor = nil;
|
||||
break;
|
||||
case kHighlightTypeBorder:
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.backgroundColor = [UIColor systemBackgroundColor];
|
||||
}
|
||||
_numberColor = [NCAppBranding elementColor];
|
||||
self.layer.borderWidth = 2;
|
||||
self.layer.borderColor = [NCAppBranding elementColor].CGColor;
|
||||
|
|
|
@ -74,7 +74,6 @@ class SettingsTableViewController: UITableViewController, UITextFieldDelegate {
|
|||
readStatusSwitch.frame = .zero
|
||||
readStatusSwitch.addTarget(self, action: #selector(readStatusValueChanged(_:)), for: .valueChanged)
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let themeColor: UIColor = NCAppBranding.themeColor()
|
||||
let themeTextColor: UIColor = NCAppBranding.themeTextColor()
|
||||
|
||||
|
@ -85,7 +84,6 @@ class SettingsTableViewController: UITableViewController, UITextFieldDelegate {
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
tableView.register(UINib(nibName: kUserSettingsTableCellNibName, bundle: nil), forCellReuseIdentifier: kUserSettingsCellIdentifier)
|
||||
|
||||
|
|
|
@ -65,17 +65,6 @@ typedef enum ShareLocationSection {
|
|||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
self.navigationController.navigationBar.translucent = NO;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
appearance.backgroundColor = themeColor;
|
||||
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
|
||||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
_locationManager = [[CLLocationManager alloc] init];
|
||||
_locationManager.delegate = self;
|
||||
[_locationManager requestWhenInUseAuthorization];
|
||||
|
@ -94,8 +83,6 @@ typedef enum ShareLocationSection {
|
|||
target:self action:@selector(cancelButtonPressed)];
|
||||
self.navigationItem.leftBarButtonItem = cancelButton;
|
||||
|
||||
// Only make search available on iOS 13+
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_resultTableViewController = [[UITableViewController alloc] init];
|
||||
_resultTableViewController.tableView.delegate = self;
|
||||
_resultTableViewController.tableView.dataSource = self;
|
||||
|
@ -141,7 +128,6 @@ typedef enum ShareLocationSection {
|
|||
// Place resultTableViewController correctly
|
||||
self.definesPresentationContext = YES;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - CLLocationManagerDelegate
|
||||
|
||||
|
@ -299,7 +285,6 @@ typedef enum ShareLocationSection {
|
|||
|
||||
- (void)searchForPlacesWithString:(NSString *)searchString
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] initWithNaturalLanguageQuery:searchString];
|
||||
MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:request];
|
||||
[search startWithCompletionHandler:^(MKLocalSearchResponse * _Nullable response, NSError * _Nullable error) {
|
||||
|
@ -311,7 +296,6 @@ typedef enum ShareLocationSection {
|
|||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Search controller
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ class SimpleTableViewController: UITableViewController {
|
|||
self.navigationController?.navigationBar.tintColor = NCAppBranding.themeTextColor()
|
||||
self.navigationController?.navigationBar.barTintColor = NCAppBranding.themeColor()
|
||||
self.tabBarController?.tabBar.tintColor = NCAppBranding.themeColor()
|
||||
if #available(iOS 13.0, *) {
|
||||
let themeColor: UIColor = NCAppBranding.themeColor()
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
|
@ -52,7 +51,6 @@ class SimpleTableViewController: UITableViewController {
|
|||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Table view data source
|
||||
|
||||
|
|
|
@ -94,13 +94,9 @@
|
|||
_dateLabel.backgroundColor = [UIColor clearColor];
|
||||
_dateLabel.userInteractionEnabled = NO;
|
||||
_dateLabel.numberOfLines = 1;
|
||||
_dateLabel.textColor = [UIColor lightGrayColor];
|
||||
_dateLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_dateLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _dateLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ class UserProfileTableViewController: UITableViewController, DetailedOptionsSele
|
|||
self.navigationController?.navigationBar.tintColor = NCAppBranding.themeTextColor()
|
||||
self.navigationController?.navigationBar.barTintColor = NCAppBranding.themeColor()
|
||||
self.tabBarController?.tabBar.tintColor = NCAppBranding.themeColor()
|
||||
if #available(iOS 13.0, *) {
|
||||
let themeColor: UIColor = NCAppBranding.themeColor()
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
|
@ -80,7 +79,6 @@ class UserProfileTableViewController: UITableViewController, DetailedOptionsSele
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
self.tableView.tableHeaderView = self.avatarHeaderView()
|
||||
self.showEditButton()
|
||||
self.getUserProfileEditableFields()
|
||||
|
|
|
@ -64,7 +64,6 @@ class UserStatusMessageViewController: UIViewController, UITextFieldDelegate {
|
|||
self.navigationController?.navigationBar.isTranslucent = false
|
||||
self.navigationItem.title = NSLocalizedString("Status message", comment: "")
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
|
||||
|
@ -72,7 +71,6 @@ class UserStatusMessageViewController: UIViewController, UITextFieldDelegate {
|
|||
self.navigationItem.standardAppearance = appearance
|
||||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
|
||||
self.navigationController?.navigationBar.topItem?.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(self.cancelButtonPressed))
|
||||
|
||||
|
|
|
@ -48,7 +48,6 @@ class UserStatusTableViewController: UITableViewController, DetailedOptionsSelec
|
|||
self.navigationController?.navigationBar.tintColor = NCAppBranding.themeTextColor()
|
||||
self.navigationController?.navigationBar.barTintColor = NCAppBranding.themeColor()
|
||||
self.tabBarController?.tabBar.tintColor = NCAppBranding.themeColor()
|
||||
if #available(iOS 13.0, *) {
|
||||
let themeColor: UIColor = NCAppBranding.themeColor()
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
|
@ -58,7 +57,6 @@ class UserStatusTableViewController: UITableViewController, DetailedOptionsSelec
|
|||
self.navigationItem.compactAppearance = appearance
|
||||
self.navigationItem.scrollEdgeAppearance = appearance
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: User Status
|
||||
|
||||
|
|
|
@ -42,12 +42,8 @@
|
|||
|
||||
self.contentView.frame = self.bounds;
|
||||
|
||||
self.contentView.backgroundColor = [UIColor whiteColor];
|
||||
self.leftBackgroundView.backgroundColor = [UIColor whiteColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.contentView.backgroundColor = [UIColor systemBackgroundColor];
|
||||
self.leftBackgroundView.backgroundColor = [UIColor systemBackgroundColor];
|
||||
}
|
||||
|
||||
[self.recordingTimeLabel setTimerType:MZTimerLabelTypeStopWatch];
|
||||
[self.recordingTimeLabel setTimeFormat:@"mm:ss"];
|
||||
|
|
|
@ -306,16 +306,9 @@
|
|||
NSString *durationTime = [dateComponentsFormatter stringFromTimeInterval:duration];
|
||||
|
||||
NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:12],
|
||||
NSForegroundColorAttributeName:[UIColor lightGrayColor]};
|
||||
NSDictionary *subAttribute = @{NSFontAttributeName:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium],
|
||||
NSForegroundColorAttributeName:[UIColor darkGrayColor]};
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:12],
|
||||
NSForegroundColorAttributeName:[UIColor secondaryLabelColor]};
|
||||
subAttribute = @{NSFontAttributeName:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium],
|
||||
NSDictionary *subAttribute = @{NSFontAttributeName:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium],
|
||||
NSForegroundColorAttributeName:[UIColor labelColor]};
|
||||
}
|
||||
|
||||
NSString *playerTime = [NSString stringWithFormat:@"%@ / %@", progressTime, durationTime];
|
||||
NSMutableAttributedString *playerTimeString = [[NSMutableAttributedString alloc] initWithString:playerTime attributes:attributes];
|
||||
|
@ -411,13 +404,9 @@
|
|||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.userInteractionEnabled = NO;
|
||||
_titleLabel.numberOfLines = 1;
|
||||
_titleLabel.textColor = [UIColor lightGrayColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:[VoiceMessageTableViewCell defaultFontSize]];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_titleLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
@ -430,13 +419,9 @@
|
|||
_dateLabel.backgroundColor = [UIColor clearColor];
|
||||
_dateLabel.userInteractionEnabled = NO;
|
||||
_dateLabel.numberOfLines = 1;
|
||||
_dateLabel.textColor = [UIColor lightGrayColor];
|
||||
_dateLabel.font = [UIFont systemFontOfSize:12.0];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_dateLabel.textColor = [UIColor secondaryLabelColor];
|
||||
}
|
||||
}
|
||||
return _dateLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
self.navigationController.navigationBar.barTintColor = [NCAppBranding themeColor];
|
||||
self.tabBarController.tabBar.tintColor = [NCAppBranding themeColor];
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -88,7 +87,6 @@
|
|||
self.navigationItem.standardAppearance = appearance;
|
||||
self.navigationItem.compactAppearance = appearance;
|
||||
self.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
self.pageControl.currentPageIndicatorTintColor = [NCAppBranding elementColor];
|
||||
self.pageControl.pageIndicatorTintColor = [NCAppBranding placeholderColor];
|
||||
|
@ -118,16 +116,9 @@
|
|||
|
||||
// Set to section
|
||||
NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:15],
|
||||
NSForegroundColorAttributeName:[UIColor darkTextColor]};
|
||||
NSDictionary *subAttribute = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:15],
|
||||
NSForegroundColorAttributeName:[UIColor lightGrayColor]};
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:15],
|
||||
NSForegroundColorAttributeName:[UIColor labelColor]};
|
||||
subAttribute = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:15],
|
||||
NSDictionary *subAttribute = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:15],
|
||||
NSForegroundColorAttributeName:[UIColor tertiaryLabelColor]};
|
||||
}
|
||||
|
||||
NSString *localizedToString = NSLocalizedString(@"To:", @"TRANSLATORS this is for sending something 'to' a user. Eg. 'To: John Doe'");
|
||||
NSMutableAttributedString *toString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", localizedToString, _room.displayName] attributes:attributes];
|
||||
|
@ -636,7 +627,6 @@
|
|||
|
||||
- (void)generatePreviewForCell:(ShareConfirmationCollectionViewCell *)cell withCollectionView:(UICollectionView *)collectionView withItem:(ShareItem *)item
|
||||
{
|
||||
if (@available(iOS 13.0, *)) {
|
||||
CGSize size = CGSizeMake(collectionView.bounds.size.width, collectionView.bounds.size.height);
|
||||
CGFloat scale = [UIScreen mainScreen].scale;
|
||||
|
||||
|
@ -652,7 +642,6 @@
|
|||
});
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInteger)collectionView:(nonnull UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return [self.shareItemController.shareItems count];
|
||||
|
@ -754,7 +743,6 @@
|
|||
preview.tabBarController.tabBar.tintColor = [NCAppBranding themeColor];
|
||||
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
appearance.backgroundColor = themeColor;
|
||||
|
@ -762,7 +750,6 @@
|
|||
preview.navigationItem.standardAppearance = appearance;
|
||||
preview.navigationItem.compactAppearance = appearance;
|
||||
preview.navigationItem.scrollEdgeAppearance = appearance;
|
||||
}
|
||||
|
||||
[self.navigationController pushViewController:preview animated:YES];
|
||||
}
|
||||
|
@ -784,7 +771,7 @@
|
|||
return 1;
|
||||
}
|
||||
|
||||
- (QLPreviewItemEditingMode)previewController:(QLPreviewController *)controller editingModeForPreviewItem:(id<QLPreviewItem>)previewItem API_AVAILABLE(ios(13.0)) {
|
||||
- (QLPreviewItemEditingMode)previewController:(QLPreviewController *)controller editingModeForPreviewItem:(id<QLPreviewItem>)previewItem {
|
||||
return QLPreviewItemEditingModeCreateCopy;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,6 @@
|
|||
cancelButton.accessibilityHint = NSLocalizedString(@"Double tap to dismiss sharing options", nil);
|
||||
self.navigationController.navigationBar.topItem.leftBarButtonItem = cancelButton;
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
UIColor *themeColor = [NCAppBranding themeColor];
|
||||
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
|
||||
[appearance configureWithOpaqueBackground];
|
||||
|
@ -180,16 +179,6 @@
|
|||
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
|
||||
[clearButton setTintColor:[NCAppBranding themeTextColor]];
|
||||
});
|
||||
} else {
|
||||
self.navigationItem.searchController = _searchController;
|
||||
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
|
||||
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
|
||||
searchTextField.tintColor = [NCAppBranding themeColor];
|
||||
UIView *backgroundview = [searchTextField.subviews firstObject];
|
||||
backgroundview.backgroundColor = [NCAppBranding backgroundColor];
|
||||
backgroundview.layer.cornerRadius = 8;
|
||||
backgroundview.clipsToBounds = YES;
|
||||
}
|
||||
|
||||
// Place resultTableViewController correctly
|
||||
self.definesPresentationContext = YES;
|
||||
|
|
Загрузка…
Ссылка в новой задаче