Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller 2022-09-29 15:59:22 +02:00
Родитель 30c1ce970f
Коммит ef8b0115a8
47 изменённых файлов: 515 добавлений и 1006 удалений

Просмотреть файл

@ -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,47 +79,36 @@
_searchController.searchResultsUpdater = self;
[_searchController.searchBar sizeToFit];
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;
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;
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[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.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
// Contacts placeholder view

Просмотреть файл

@ -114,9 +114,7 @@
// 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];
}
[self scheduleAppRefresh];
}
@ -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];
}
// see: https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler?language=objc
[[BGTaskScheduler sharedScheduler] registerForTaskWithIdentifier:refreshTaskIdentifier
usingQueue:nil
launchHandler:^(__kindof BGTask * _Nonnull task) {
[self handleAppRefresh:task];
}];
}
- (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,9 +49,7 @@ 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;
}
self.modalPresentationStyle = ([[NCDatabaseManager sharedInstance] numberOfAccounts] == 0) ? UIModalPresentationFullScreen : UIModalPresentationAutomatic;
}
return self;

Просмотреть файл

@ -136,13 +136,8 @@
[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.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,12 +209,8 @@
_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];
}
_titleLabel.textColor = [UIColor secondaryLabelColor];
}
return _titleLabel;
}
@ -233,12 +224,8 @@
_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];
}
_dateLabel.textColor = [UIColor secondaryLabelColor];
}
return _dateLabel;
}
@ -338,10 +325,7 @@
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.bodyTextView.textColor = [UIColor tertiaryLabelColor];
}
[self.reactionsView updateReactionsWithReactions:message.reactionsArray];

Просмотреть файл

@ -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.textColor = [UIColor labelColor];
self.labelTitle.font = [UIFont systemFontOfSize:kContactsTableCellTitleFontSize weight:UIFontWeightRegular];
}

Просмотреть файл

@ -55,16 +55,14 @@
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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
}
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;
self.navigationController.title = self.title;

Просмотреть файл

@ -135,16 +135,14 @@ 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()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let themeColor: UIColor = NCAppBranding.themeColor()
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
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,16 +91,14 @@
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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
}
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;
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.borderColor = [[UIColor secondarySystemFillColor] CGColor];
weakSelf.previewImageView.layer.borderWidth = 1.0f;
dispatch_async(dispatch_get_main_queue(), ^(void){
@ -385,12 +382,8 @@
_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];
}
_titleLabel.textColor = [UIColor secondaryLabelColor];
}
return _titleLabel;
}
@ -404,12 +397,8 @@
_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];
}
_dateLabel.textColor = [UIColor secondaryLabelColor];
}
return _dateLabel;
}

Просмотреть файл

@ -113,10 +113,7 @@
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.bodyTextView.textColor = [UIColor tertiaryLabelColor];
}
[self.reactionsView updateReactionsWithReactions:message.reactionsArray];
if (message.reactionsArray.count > 0) {

Просмотреть файл

@ -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];
}
_label.textColor = [UIColor secondaryLabelColor];
[self addSubview:self.contentView];

Просмотреть файл

@ -292,12 +292,8 @@
_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];
}
_titleLabel.textColor = [UIColor secondaryLabelColor];
}
return _titleLabel;
}
@ -311,12 +307,8 @@
_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];
}
_dateLabel.textColor = [UIColor secondaryLabelColor];
}
return _dateLabel;
}

Просмотреть файл

@ -49,16 +49,14 @@
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;
}
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;

Просмотреть файл

@ -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.backgroundColor = [UIColor secondarySystemBackgroundColor];
[self configureSubviews];
}
@ -72,13 +68,9 @@
_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];
}
_separatorLabel.textColor = [UIColor secondaryLabelColor];
}
return _separatorLabel;
}

Просмотреть файл

@ -111,13 +111,11 @@ 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];
UIColor *elementColorBright = [NCUtils colorFromHexString:serverCapabilities.colorElementBright];
UIColor *elementColorDark = [NCUtils colorFromHexString:serverCapabilities.colorElementDark];
if (elementColorBright && elementColorDark) {
return [self getDynamicColor:elementColorBright withDarkMode:elementColorDark];
}
if (elementColorBright && elementColorDark) {
return [self getDynamicColor:elementColorBright withDarkMode:elementColorDark];
}
UIColor *color = [NCUtils colorFromHexString:serverCapabilities.colorElement];
@ -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,42 +154,26 @@ 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
return [UIColor placeholderTextColor];
}
+ (UIColor *)backgroundColor
{
if (@available(iOS 13.0, *)) {
return [UIColor systemBackgroundColor];
}
return [UIColor whiteColor];
return [UIColor systemBackgroundColor];
}
+ (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 *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];
}
+ (UIColor *)chatForegroundColor
{
if (@available(iOS 13.0, *)) {
return [self getDynamicColor:[UIColor darkGrayColor] withDarkMode:[UIColor labelColor]];
}
return [UIColor darkGrayColor];
return [self getDynamicColor:[UIColor darkGrayColor] withDarkMode:[UIColor labelColor]];
}
+ (UIStatusBarStyle)statusBarStyleForBrandColor
@ -210,20 +192,11 @@ BOOL const useServerThemimg = YES;
+ (UIStatusBarStyle)statusBarStyleForTextColorStyle:(NCTextColorStyle)style
{
switch (style) {
case NCTextColorStyleDark:
{
if (@available(iOS 13.0, *)) {
return UIStatusBarStyleDarkContent;
}
return UIStatusBarStyleDefault;
}
break;
case NCTextColorStyleLight:
default:
return UIStatusBarStyleLightContent;
break;
if (style == NCTextColorStyleDark) {
return UIStatusBarStyleDarkContent;
}
return UIStatusBarStyleLightContent;
}
+ (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)];
}
//TODO: Further adjust for dark-mode ?
[message addAttribute:NSForegroundColorAttributeName value:[UIColor tertiaryLabelColor] range:NSMakeRange(0,message.length)];
return message;
}

Просмотреть файл

@ -257,23 +257,21 @@ 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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
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;
[self.view setBackgroundColor:[UIColor systemBackgroundColor]];
[self.textInputbar setBackgroundColor:[UIColor systemBackgroundColor]];
[self.view setBackgroundColor:[UIColor systemBackgroundColor]];
[self.textInputbar setBackgroundColor:[UIColor systemBackgroundColor]];
[self.textInputbar.editorTitle setTextColor:[UIColor labelColor]];
[self.textView.layer setBorderWidth:1.0];
[self.textView.layer setBorderColor:[UIColor systemGray4Color].CGColor];
}
[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.inputbarBorderView.backgroundColor = [UIColor systemGray6Color];
[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];
}
self.autoCompletionView.backgroundColor = [UIColor secondarySystemBackgroundColor];
if (@available(iOS 15.0, *)) {
self.autoCompletionView.sectionHeaderTopPadding = 0;
}
@ -566,13 +552,11 @@ 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];
[self.textView setTintColor:[UIColor colorWithCGColor:[UIColor systemBlueColor].CGColor]];
[self updateToolbar:YES];
}
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];
[self.textView setTintColor:[UIColor colorWithCGColor:[UIColor systemBlueColor].CGColor]];
[self updateToolbar:YES];
}
}
@ -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];
}
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,15 +3865,13 @@ 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;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
preview.navigationItem.standardAppearance = appearance;
preview.navigationItem.compactAppearance = appearance;
preview.navigationItem.scrollEdgeAppearance = appearance;
}
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
preview.navigationItem.standardAppearance = appearance;
preview.navigationItem.compactAppearance = appearance;
preview.navigationItem.scrollEdgeAppearance = appearance;
[self presentViewController:preview animated:YES completion:nil];
});

Просмотреть файл

@ -42,15 +42,13 @@
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];
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
}
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = [NCAppBranding themeColor];
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
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;
}
_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;
}
_loginViewController.modalPresentationStyle = ([[NCDatabaseManager sharedInstance] numberOfAccounts] == 0) ? UIModalPresentationFullScreen : UIModalPresentationAutomatic;
[_mainNavigationController presentViewController:_loginViewController animated:YES completion:nil];
}
}

Просмотреть файл

@ -93,47 +93,36 @@ 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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
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;
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[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.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

Просмотреть файл

@ -188,10 +188,7 @@
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.objectTypeImageView setTintColor:[UIColor labelColor]];
}
[self.reactionsView updateReactionsWithReactions:message.reactionsArray];
@ -268,12 +265,8 @@
_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];
}
_titleLabel.textColor = [UIColor secondaryLabelColor];
}
return _titleLabel;
}
@ -287,12 +280,8 @@
_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];
}
_dateLabel.textColor = [UIColor secondaryLabelColor];
}
return _dateLabel;
}

Просмотреть файл

@ -68,15 +68,13 @@ 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()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
appearance.backgroundColor = NCAppBranding.themeColor()
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,15 +63,13 @@ 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()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
func cancelButtonPressed() {

Просмотреть файл

@ -62,15 +62,13 @@ 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()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
appearance.backgroundColor = NCAppBranding.themeColor()
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
}
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.backgroundColor = [UIColor secondarySystemBackgroundColor];
[self addSubview:self.quoteView];
[self addSubview:self.actorLabel];
@ -70,10 +66,7 @@
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];
}
_quoteView.backgroundColor = [UIColor systemFillColor];
}
return _quoteView;
}
@ -89,11 +82,7 @@
_actorLabel.contentMode = UIViewContentModeLeft;
_actorLabel.font = [UIFont systemFontOfSize:14.0];
_actorLabel.textColor = [UIColor lightGrayColor];
if (@available(iOS 13.0, *)) {
_actorLabel.textColor = [UIColor secondaryLabelColor];
}
_actorLabel.textColor = [UIColor secondaryLabelColor];
}
return _actorLabel;
}
@ -109,11 +98,7 @@
_messageLabel.contentMode = UIViewContentModeLeft;
_messageLabel.font = [UIFont systemFontOfSize:14.0];
_messageLabel.textColor = [UIColor darkGrayColor];
if (@available(iOS 13.0, *)) {
_messageLabel.textColor = [NCAppBranding chatForegroundColor];
}
_messageLabel.textColor = [NCAppBranding chatForegroundColor];
}
return _messageLabel;
}
@ -127,10 +112,7 @@
if (_highlighted) {
_quoteView.backgroundColor = [NCAppBranding themeColor];
} else {
_quoteView.backgroundColor = [UIColor lightGrayColor];
if (@available(iOS 13.0, *)) {
_quoteView.backgroundColor = [UIColor systemFillColor];
}
_quoteView.backgroundColor = [UIColor systemFillColor];
}
}

Просмотреть файл

@ -46,15 +46,13 @@ 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()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
reactionsBackgroundView.placeholderView.isHidden = true
reactionsBackgroundView.loadingView.startAnimating()

Просмотреть файл

@ -42,10 +42,7 @@ import UIKit
}
func borderColor() -> CGColor {
if #available(iOS 13.0, *) {
return UIColor.tertiaryLabel.cgColor
}
return UIColor.lightGray.cgColor
return UIColor.tertiaryLabel.cgColor
}
func sizeForReaction(reaction: NCChatReaction) -> CGSize {

Просмотреть файл

@ -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.backgroundColor = [UIColor secondarySystemBackgroundColor];
[self addSubview:self.quoteContainerView];
[self addSubview:self.cancelButton];
@ -87,11 +83,9 @@
- (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;
}
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;
}
}
@ -144,11 +138,7 @@
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;
}
_topBorder.backgroundColor = [UIColor systemGray4Color].CGColor;
}
return _topBorder;
}

Просмотреть файл

@ -88,16 +88,14 @@ 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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
}
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;
_passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(180, 10, 115, 30)];
_passwordTextField.textAlignment = NSTextAlignmentRight;

Просмотреть файл

@ -77,47 +77,36 @@
_searchController.searchResultsUpdater = self;
[_searchController.searchBar sizeToFit];
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;
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;
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[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.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
// We want ourselves to be the delegate for the result table so didSelectRowAtIndexPath is called for both tables.
_resultTableViewController.tableView.delegate = self;

Просмотреть файл

@ -182,16 +182,14 @@ 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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
}
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;
_roomParticipants = [[NSMutableArray alloc] init];
@ -2402,15 +2400,13 @@ 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;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
preview.navigationItem.standardAppearance = appearance;
preview.navigationItem.compactAppearance = appearance;
preview.navigationItem.scrollEdgeAppearance = appearance;
}
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
preview.navigationItem.standardAppearance = appearance;
preview.navigationItem.compactAppearance = appearance;
preview.navigationItem.scrollEdgeAppearance = appearance;
[self.navigationController pushViewController:preview animated:YES];

Просмотреть файл

@ -53,15 +53,13 @@ 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()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
appearance.backgroundColor = NCAppBranding.themeColor()
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)
@ -80,7 +78,7 @@ import QuickLook
}
if itemType == currentItemType {
action.setValue(UIImage(named: "checkmark")?.withRenderingMode(_:.alwaysOriginal), forKey: "image")
action.setValue(UIImage(named: "checkmark")?.withRenderingMode(_: .alwaysOriginal), forKey: "image")
}
itemTypesActionSheet.addAction(action)
}

Просмотреть файл

@ -173,46 +173,35 @@ 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];
appearance.backgroundColor = themeColor;
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
UIColor *themeColor = [NCAppBranding themeColor];
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = themeColor;
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[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.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
[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];
}
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];
}
self.backgroundColor = [UIColor systemBackgroundColor];
_numberColor = [NCAppBranding elementColor];
self.layer.borderWidth = 2;
self.layer.borderColor = [NCAppBranding elementColor].CGColor;

Просмотреть файл

@ -74,18 +74,16 @@ 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()
let themeColor: UIColor = NCAppBranding.themeColor()
let themeTextColor: UIColor = NCAppBranding.themeTextColor()
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: themeTextColor]
appearance.backgroundColor = themeColor
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: themeTextColor]
appearance.backgroundColor = themeColor
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,53 +83,50 @@ 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;
_resultTableViewController.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
_resultTableViewController = [[UITableViewController alloc] init];
_resultTableViewController.tableView.delegate = self;
_resultTableViewController.tableView.dataSource = self;
_resultTableViewController.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
_searchController = [[UISearchController alloc] initWithSearchResultsController:_resultTableViewController];
_searchController.delegate = self;
_searchController.searchResultsUpdater = self;
_searchController.hidesNavigationBarDuringPresentation = NO;
[_searchController.searchBar sizeToFit];
_searchController = [[UISearchController alloc] initWithSearchResultsController:_resultTableViewController];
_searchController.delegate = self;
_searchController.searchResultsUpdater = self;
_searchController.hidesNavigationBarDuringPresentation = NO;
[_searchController.searchBar sizeToFit];
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;
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;
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search for places", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search for places", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
// Place resultTableViewController correctly
self.definesPresentationContext = YES;
}
// Place resultTableViewController correctly
self.definesPresentationContext = YES;
}
#pragma mark - CLLocationManagerDelegate
@ -299,18 +285,16 @@ 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) {
if (response) {
dispatch_async(dispatch_get_main_queue(), ^{
self->_searchedPlaces = response.mapItems;
[self->_resultTableViewController.tableView reloadData];
});
}
}];
}
MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] initWithNaturalLanguageQuery:searchString];
MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse * _Nullable response, NSError * _Nullable error) {
if (response) {
dispatch_async(dispatch_get_main_queue(), ^{
self->_searchedPlaces = response.mapItems;
[self->_resultTableViewController.tableView reloadData];
});
}
}];
}
#pragma mark - Search controller

Просмотреть файл

@ -42,16 +42,14 @@ 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()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let themeColor: UIColor = NCAppBranding.themeColor()
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
// MARK: Table view data source

Просмотреть файл

@ -94,12 +94,8 @@
_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];
}
_dateLabel.textColor = [UIColor secondaryLabelColor];
}
return _dateLabel;
}

Просмотреть файл

@ -71,16 +71,14 @@ 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()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let themeColor: UIColor = NCAppBranding.themeColor()
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
self.tableView.tableHeaderView = self.avatarHeaderView()
self.showEditButton()
self.getUserProfileEditableFields()

Просмотреть файл

@ -64,15 +64,13 @@ 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()]
appearance.backgroundColor = NCAppBranding.themeColor()
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
appearance.backgroundColor = NCAppBranding.themeColor()
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,16 +48,14 @@ 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()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
self.navigationItem.compactAppearance = appearance
self.navigationItem.scrollEdgeAppearance = appearance
}
let themeColor: UIColor = NCAppBranding.themeColor()
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = themeColor
appearance.titleTextAttributes = [.foregroundColor: NCAppBranding.themeTextColor()]
self.navigationItem.standardAppearance = appearance
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.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]};
NSForegroundColorAttributeName:[UIColor secondaryLabelColor]};
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],
NSForegroundColorAttributeName:[UIColor labelColor]};
}
NSForegroundColorAttributeName:[UIColor labelColor]};
NSString *playerTime = [NSString stringWithFormat:@"%@ / %@", progressTime, durationTime];
NSMutableAttributedString *playerTimeString = [[NSMutableAttributedString alloc] initWithString:playerTime attributes:attributes];
@ -411,12 +404,8 @@
_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];
}
_titleLabel.textColor = [UIColor secondaryLabelColor];
}
return _titleLabel;
}
@ -430,12 +419,8 @@
_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];
}
_dateLabel.textColor = [UIColor secondaryLabelColor];
}
return _dateLabel;
}

Просмотреть файл

@ -79,16 +79,14 @@
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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
}
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;
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]};
NSForegroundColorAttributeName:[UIColor labelColor]};
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],
NSForegroundColorAttributeName:[UIColor tertiaryLabelColor]};
}
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,22 +627,20 @@
- (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;
CGSize size = CGSizeMake(collectionView.bounds.size.width, collectionView.bounds.size.height);
CGFloat scale = [UIScreen mainScreen].scale;
// updateHandler might be called multiple times, starting from low quality representation to high-quality
QLThumbnailGenerationRequest *request = [[QLThumbnailGenerationRequest alloc] initWithFileAtURL:item.fileURL size:size scale:scale representationTypes:(QLThumbnailGenerationRequestRepresentationTypeLowQualityThumbnail | QLThumbnailGenerationRequestRepresentationTypeThumbnail)];
[QLThumbnailGenerator.sharedGenerator generateRepresentationsForRequest:request updateHandler:^(QLThumbnailRepresentation * _Nullable thumbnail, QLThumbnailRepresentationType type, NSError * _Nullable error) {
if (error) {
return;
}
// updateHandler might be called multiple times, starting from low quality representation to high-quality
QLThumbnailGenerationRequest *request = [[QLThumbnailGenerationRequest alloc] initWithFileAtURL:item.fileURL size:size scale:scale representationTypes:(QLThumbnailGenerationRequestRepresentationTypeLowQualityThumbnail | QLThumbnailGenerationRequestRepresentationTypeThumbnail)];
[QLThumbnailGenerator.sharedGenerator generateRepresentationsForRequest:request updateHandler:^(QLThumbnailRepresentation * _Nullable thumbnail, QLThumbnailRepresentationType type, NSError * _Nullable error) {
if (error) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
[cell setPreviewImage:thumbnail.UIImage];
});
}];
}
dispatch_async(dispatch_get_main_queue(), ^{
[cell setPreviewImage:thumbnail.UIImage];
});
}];
}
- (NSInteger)collectionView:(nonnull UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
@ -754,15 +743,13 @@
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;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
preview.navigationItem.standardAppearance = appearance;
preview.navigationItem.compactAppearance = appearance;
preview.navigationItem.scrollEdgeAppearance = appearance;
}
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
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,47 +149,36 @@
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];
appearance.backgroundColor = themeColor;
appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[NCAppBranding themeTextColor]};
self.navigationItem.standardAppearance = appearance;
self.navigationItem.compactAppearance = appearance;
self.navigationItem.scrollEdgeAppearance = appearance;
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;
self.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[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.navigationItem.searchController = _searchController;
self.navigationItem.searchController.searchBar.searchTextField.backgroundColor = [NCUtils searchbarBGColorForColor:themeColor];
_searchController.searchBar.tintColor = [NCAppBranding themeTextColor];
UITextField *searchTextField = [_searchController.searchBar valueForKey:@"searchField"];
UIButton *clearButton = [searchTextField valueForKey:@"_clearButton"];
searchTextField.tintColor = [NCAppBranding themeTextColor];
searchTextField.textColor = [NCAppBranding themeTextColor];
dispatch_async(dispatch_get_main_queue(), ^{
// Search bar placeholder
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", nil)
attributes:@{NSForegroundColorAttributeName:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]}];
// Search bar search icon
UIImageView *searchImageView = (UIImageView *)searchTextField.leftView;
searchImageView.image = [searchImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[searchImageView setTintColor:[[NCAppBranding themeTextColor] colorWithAlphaComponent:0.5]];
// Search bar search clear button
UIImage *clearButtonImage = [clearButton.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[clearButton setImage:clearButtonImage forState:UIControlStateNormal];
[clearButton setImage:clearButtonImage forState:UIControlStateHighlighted];
[clearButton setTintColor:[NCAppBranding themeTextColor]];
});
// Place resultTableViewController correctly
self.definesPresentationContext = YES;