diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 587b8f141..4f0a971ad 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -422,7 +422,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [NSBundle mxk_setFallbackLanguage:@"en"]; // Define the navigation bar text color - [[UINavigationBar appearance] setTintColor:ThemeService.theme.tintColor]; + [[UINavigationBar appearance] setTintColor:ThemeService.shared.theme.tintColor]; // Customize the localized string table [NSBundle mxk_customizeLocalizedStringTableName:@"Vector"]; @@ -444,8 +444,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN UINavigationController *secondNavController = self.secondaryNavigationController; if (secondNavController) { - secondNavController.navigationBar.barTintColor = ThemeService.theme.backgroundColor; - secondNavController.topViewController.view.backgroundColor = ThemeService.theme.backgroundColor; + secondNavController.navigationBar.barTintColor = ThemeService.shared.theme.backgroundColor; + secondNavController.topViewController.view.backgroundColor = ThemeService.shared.theme.backgroundColor; } // on IOS 8 iPad devices, force to display the primary and the secondary viewcontroller @@ -835,7 +835,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; UIViewController *emptyDetailsViewController = [storyboard instantiateViewControllerWithIdentifier:@"EmptyDetailsViewControllerStoryboardId"]; - emptyDetailsViewController.view.backgroundColor = ThemeService.theme.backgroundColor; + emptyDetailsViewController.view.backgroundColor = ThemeService.shared.theme.backgroundColor; splitViewController.viewControllers = @[mainViewController, emptyDetailsViewController]; } @@ -2825,7 +2825,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (!launchAnimationContainerView && window) { launchAnimationContainerView = [[UIView alloc] initWithFrame:window.bounds]; - launchAnimationContainerView.backgroundColor = ThemeService.theme.backgroundColor; + launchAnimationContainerView.backgroundColor = ThemeService.shared.theme.backgroundColor; launchAnimationContainerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [window addSubview:launchAnimationContainerView]; @@ -3531,7 +3531,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [_callStatusBarButton setTitle:buttonTitle forState:UIControlStateNormal]; [_callStatusBarButton setTitle:buttonTitle forState:UIControlStateHighlighted]; - _callStatusBarButton.titleLabel.textColor = ThemeService.theme.backgroundColor; + _callStatusBarButton.titleLabel.textColor = ThemeService.shared.theme.backgroundColor; if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) { @@ -3542,7 +3542,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN _callStatusBarButton.titleLabel.font = [UIFont boldSystemFontOfSize:17]; } - [_callStatusBarButton setBackgroundColor:ThemeService.theme.tintColor]; + [_callStatusBarButton setBackgroundColor:ThemeService.shared.theme.tintColor]; [_callStatusBarButton addTarget:self action:@selector(onCallStatusBarButtonPressed) forControlEvents:UIControlEventTouchUpInside]; // Place button into the new window @@ -3691,7 +3691,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; UIViewController *emptyDetailsViewController = [storyboard instantiateViewControllerWithIdentifier:@"EmptyDetailsViewControllerStoryboardId"]; - emptyDetailsViewController.view.backgroundColor = ThemeService.theme.backgroundColor; + emptyDetailsViewController.view.backgroundColor = ThemeService.shared.theme.backgroundColor; return emptyDetailsViewController; } diff --git a/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m b/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m index 69a71028e..92e6044b6 100644 --- a/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m +++ b/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m @@ -62,7 +62,7 @@ NSString *const kMXKRoomBubbleCellTapOnReceiptsContainer = @"kMXKRoomBubbleCellT timeLabel.text = [bubbleData.eventFormatter timeStringFromDate:component.date]; timeLabel.textAlignment = NSTextAlignmentRight; - timeLabel.textColor = ThemeService.theme.textSecondaryColor; + timeLabel.textColor = ThemeService.shared.theme.textSecondaryColor; if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) { timeLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightLight]; @@ -209,7 +209,7 @@ NSString *const kMXKRoomBubbleCellTapOnReceiptsContainer = @"kMXKRoomBubbleCellT markPosY, VECTOR_ROOMBUBBLETABLEVIEWCELL_MARK_WIDTH, markHeight)]; - markerView.backgroundColor = ThemeService.theme.tintColor; + markerView.backgroundColor = ThemeService.shared.theme.tintColor; [markerView setTranslatesAutoresizingMaskIntoConstraints:NO]; markerView.accessibilityIdentifier = @"markerView"; @@ -264,7 +264,7 @@ NSString *const kMXKRoomBubbleCellTapOnReceiptsContainer = @"kMXKRoomBubbleCellT timeLabel.text = [bubbleData.eventFormatter dateStringFromDate:date withTime:NO]; timeLabel.textAlignment = NSTextAlignmentRight; - timeLabel.textColor = ThemeService.theme.textSecondaryColor; + timeLabel.textColor = ThemeService.shared.theme.textSecondaryColor; if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) { timeLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightLight]; @@ -321,7 +321,7 @@ NSString *const kMXKRoomBubbleCellTapOnReceiptsContainer = @"kMXKRoomBubbleCellT if (blurred) { self.bubbleOverlayContainer.hidden = NO; - self.bubbleOverlayContainer.backgroundColor = ThemeService.theme.backgroundColor; + self.bubbleOverlayContainer.backgroundColor = ThemeService.shared.theme.backgroundColor; self.bubbleOverlayContainer.alpha = 0.8; self.bubbleOverlayContainer.userInteractionEnabled = YES; diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 3e4647e66..7f4fe2eef 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -95,7 +95,7 @@ self.searchBar.text = @""; // Customize search bar - [ThemeService.theme applyStyleOnSearchBar:self.searchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:self.searchBar]; // Remove navigation buttons self.navigationItem.hidesBackButton = YES; @@ -134,7 +134,7 @@ - (void)addBackgroundImageViewToView:(UIView*)view { - UIImage *searchBgImage = [MXKTools paintImage:[UIImage imageNamed:@"search_bg"] withColor:ThemeService.theme.matrixSearchBackgroundImageTintColor]; + UIImage *searchBgImage = [MXKTools paintImage:[UIImage imageNamed:@"search_bg"] withColor:ThemeService.shared.theme.matrixSearchBackgroundImageTintColor]; UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:searchBgImage]; backgroundImageView.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/Riot/Constants/ThemeService.h b/Riot/Constants/ThemeService.h index 1cc4443ba..8d501c4dc 100644 --- a/Riot/Constants/ThemeService.h +++ b/Riot/Constants/ThemeService.h @@ -1,6 +1,7 @@ /* Copyright 2015 OpenMarket Ltd Copyright 2017 Vector Creations Ltd + Copyright 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -48,14 +49,34 @@ extern NSInteger const kRiotRoomModeratorLevel; extern NSInteger const kRiotRoomAdminLevel; /** - `ThemeService` class manages the Riot design parameters + `ThemeService` class manages the application design values. */ @interface ThemeService : NSObject +/** + Returns the shared instance. + + @return the shared instance. + */ ++ (instancetype)shared; + +/** + The id of the theme corresponding to the current app settings. + */ +@property (nonatomic, readonly) NSString *themeId; + /** The current theme. */ -+ (id)theme; +@property (nonatomic, readonly) id theme; + +/** + Get the theme with the given id. + + @param themeId the theme id. + @return the theme. + */ +- (id)themeWithThemeId:(NSString*)themeId; @end diff --git a/Riot/Constants/ThemeService.m b/Riot/Constants/ThemeService.m index b752be420..d29b5799e 100644 --- a/Riot/Constants/ThemeService.m +++ b/Riot/Constants/ThemeService.m @@ -1,6 +1,7 @@ /* Copyright 2016 OpenMarket Ltd Copyright 2017 Vector Creations Ltd + Copyright 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -40,18 +41,52 @@ NSInteger const kRiotRoomAdminLevel = 100; @implementation ThemeService -+ (ThemeService *)sharedInstance ++ (ThemeService *)shared { static ThemeService *sharedOnceInstance; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - sharedOnceInstance = [[ThemeService alloc] init]; + sharedOnceInstance = [ThemeService new]; }); return sharedOnceInstance; } +- (NSString*)themeId +{ + // Retrieve the current selected theme ("light" if none. "auto" is used as default from iOS 11). + NSString *themeId = RiotSettings.shared.userInterfaceTheme; + + if (!themeId || [themeId isEqualToString:@"auto"]) + { + themeId = UIAccessibilityIsInvertColorsEnabled() ? @"dark" : @"light"; + } + + return themeId; +} + +- (id)themeWithThemeId:(NSString*)themeId +{ + // Use light theme colors by default. + id theme = DefaultTheme.shared; + + if ([themeId isEqualToString:@"dark"]) + { + // Set dark theme colors + theme = DarkTheme.shared; + } + else if ([themeId isEqualToString:@"black"]) + { + // TODO: Use dark theme colors for the moment + theme = DarkTheme.shared; + } + + return theme; +} + +#pragma mark - Private methods + + (void)load { [super load]; @@ -66,12 +101,14 @@ NSInteger const kRiotRoomAdminLevel = 100; kRiotColorIndigo = UIColorFromRGB(0xBD79CC); kRiotColorOrange = UIColorFromRGB(0xF8A15F); + ThemeService *themeService = ThemeService.shared; + // Observe user interface theme change. - [[NSUserDefaults standardUserDefaults] addObserver:[ThemeService sharedInstance] forKeyPath:@"userInterfaceTheme" options:0 context:nil]; - [[ThemeService sharedInstance] userInterfaceThemeDidChange]; + [[NSUserDefaults standardUserDefaults] addObserver:themeService forKeyPath:@"userInterfaceTheme" options:0 context:nil]; + [themeService userInterfaceThemeDidChange]; // Observe "Invert Colours" settings changes (available since iOS 11) - [[NSNotificationCenter defaultCenter] addObserver:[ThemeService sharedInstance] selector:@selector(accessibilityInvertColorsStatusDidChange) name:UIAccessibilityInvertColorsStatusDidChangeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:themeService selector:@selector(accessibilityInvertColorsStatusDidChange) name:UIAccessibilityInvertColorsStatusDidChangeNotification object:nil]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context @@ -94,40 +131,12 @@ NSInteger const kRiotRoomAdminLevel = 100; - (void)userInterfaceThemeDidChange { - [UIScrollView appearance].indicatorStyle = ThemeService.theme.scrollBarStyle; + // Update the current theme + _theme = [self themeWithThemeId:self.themeId]; + + [UIScrollView appearance].indicatorStyle = self.theme.scrollBarStyle; [[NSNotificationCenter defaultCenter] postNotificationName:kThemeServiceDidChangeThemeNotification object:nil]; } -+ (id)theme -{ - id theme; - - // Retrieve the current selected theme ("light" if none. "auto" is used as default from iOS 11). - NSString *themeId = RiotSettings.shared.userInterfaceTheme; - - if (!themeId || [themeId isEqualToString:@"auto"]) - { - themeId = UIAccessibilityIsInvertColorsEnabled() ? @"dark" : @"light"; - } - - if ([themeId isEqualToString:@"dark"]) - { - // Set dark theme colors - theme = DarkTheme.shared; - } - else if ([themeId isEqualToString:@"black"]) - { - // TODO: Use dark theme colors for the moment - theme = DarkTheme.shared; - } - else - { - // Set light theme colors by default. - theme = DefaultTheme.shared; - } - - return theme; -} - @end diff --git a/Riot/Modules/Authentication/AuthenticationViewController.m b/Riot/Modules/Authentication/AuthenticationViewController.m index f2bdae672..ae37370bb 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/AuthenticationViewController.m @@ -131,52 +131,52 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.view.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; - self.authenticationScrollView.backgroundColor = ThemeService.theme.backgroundColor; - self.authFallbackContentView.backgroundColor = ThemeService.theme.backgroundColor; + self.authenticationScrollView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.authFallbackContentView.backgroundColor = ThemeService.shared.theme.backgroundColor; - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { if (self.homeServerTextField.placeholder) { self.homeServerTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.homeServerTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } if (self.identityServerTextField.placeholder) { self.identityServerTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.identityServerTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } } - self.submitButton.backgroundColor = ThemeService.theme.tintColor; - self.skipButton.backgroundColor = ThemeService.theme.tintColor; + self.submitButton.backgroundColor = ThemeService.shared.theme.tintColor; + self.skipButton.backgroundColor = ThemeService.shared.theme.tintColor; self.noFlowLabel.textColor = kRiotColorRed; NSMutableAttributedString *forgotPasswordTitle = [[NSMutableAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"auth_forgot_password", @"Vector", nil)]; [forgotPasswordTitle addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:NSMakeRange(0, forgotPasswordTitle.length)]; - [forgotPasswordTitle addAttribute:NSForegroundColorAttributeName value:ThemeService.theme.tintColor range:NSMakeRange(0, forgotPasswordTitle.length)]; + [forgotPasswordTitle addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.tintColor range:NSMakeRange(0, forgotPasswordTitle.length)]; [self.forgotPasswordButton setAttributedTitle:forgotPasswordTitle forState:UIControlStateNormal]; [self.forgotPasswordButton setAttributedTitle:forgotPasswordTitle forState:UIControlStateHighlighted]; [self updateForgotPwdButtonVisibility]; - NSAttributedString *serverOptionsTitle = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"auth_use_server_options", @"Vector", nil) attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textSecondaryColor, NSFontAttributeName: [UIFont systemFontOfSize:14]}]; + NSAttributedString *serverOptionsTitle = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"auth_use_server_options", @"Vector", nil) attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textSecondaryColor, NSFontAttributeName: [UIFont systemFontOfSize:14]}]; [self.customServersTickButton setAttributedTitle:serverOptionsTitle forState:UIControlStateNormal]; [self.customServersTickButton setAttributedTitle:serverOptionsTitle forState:UIControlStateHighlighted]; - self.homeServerTextField.textColor = ThemeService.theme.textPrimaryColor; - self.homeServerLabel.textColor = ThemeService.theme.textSecondaryColor; + self.homeServerTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.homeServerLabel.textColor = ThemeService.shared.theme.textSecondaryColor; - self.identityServerTextField.textColor = ThemeService.theme.textPrimaryColor; - self.identityServerLabel.textColor = ThemeService.theme.textSecondaryColor; + self.identityServerTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.identityServerLabel.textColor = ThemeService.shared.theme.textSecondaryColor; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; [self.authInputsView customizeViewRendering]; @@ -185,7 +185,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)viewWillAppear:(BOOL)animated diff --git a/Riot/Modules/Authentication/Views/AuthInputsView.m b/Riot/Modules/Authentication/Views/AuthInputsView.m index 3a67b064c..a1a55cc73 100644 --- a/Riot/Modules/Authentication/Views/AuthInputsView.m +++ b/Riot/Modules/Authentication/Views/AuthInputsView.m @@ -72,7 +72,7 @@ self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_password_placeholder", @"Vector", nil); self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_password_placeholder", @"Vector", nil); - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { // Apply placeholder color [self customizeViewRendering]; @@ -103,33 +103,33 @@ { [super customizeViewRendering]; - self.repeatPasswordTextField.textColor = ThemeService.theme.textPrimaryColor; - self.userLoginTextField.textColor = ThemeService.theme.textPrimaryColor; - self.passWordTextField.textColor = ThemeService.theme.textPrimaryColor; + self.repeatPasswordTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.userLoginTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.passWordTextField.textColor = ThemeService.shared.theme.textPrimaryColor; - self.emailTextField.textColor = ThemeService.theme.textPrimaryColor; - self.phoneTextField.textColor = ThemeService.theme.textPrimaryColor; + self.emailTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.phoneTextField.textColor = ThemeService.shared.theme.textPrimaryColor; - self.isoCountryCodeLabel.textColor = ThemeService.theme.textPrimaryColor; - self.callingCodeLabel.textColor = ThemeService.theme.textPrimaryColor; + self.isoCountryCodeLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.callingCodeLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.messageLabel.textColor = ThemeService.theme.textSecondaryColor; + self.messageLabel.textColor = ThemeService.shared.theme.textSecondaryColor; self.messageLabel.numberOfLines = 0; - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { if (self.userLoginTextField.placeholder) { self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.userLoginTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } if (self.repeatPasswordTextField.placeholder) { self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.repeatPasswordTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } @@ -137,21 +137,21 @@ { self.passWordTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.passWordTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } if (self.phoneTextField.placeholder) { self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.phoneTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } if (self.emailTextField.placeholder) { self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.emailTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } } } @@ -196,14 +196,14 @@ self.messageLabel.text = NSLocalizedStringFromTable(@"or", @"Vector", nil); self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_phone_placeholder", @"Vector", nil); - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.userLoginTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.phoneTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } self.userLoginContainer.hidden = NO; @@ -1025,11 +1025,11 @@ { self.passWordTextField.returnKeyType = UIReturnKeyNext; - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"auth_user_name_placeholder", @"Vector", nil) - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } else { @@ -1057,11 +1057,11 @@ self.emailTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_email_placeholder", @"Vector", nil); } - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.emailTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } self.emailContainer.hidden = NO; @@ -1085,11 +1085,11 @@ self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_phone_placeholder", @"Vector", nil); } - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.phoneTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } self.phoneContainer.hidden = NO; @@ -1149,7 +1149,7 @@ phoneNumberPickerNavigationController = [[RiotNavigationController alloc] init]; // Set Riot navigation bar colors - [ThemeService.theme applyStyleOnNavigationBar:phoneNumberPickerNavigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:phoneNumberPickerNavigationController.navigationBar]; [phoneNumberPickerNavigationController pushViewController:phoneNumberCountryPicker animated:NO]; diff --git a/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m b/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m index 4902677a9..0da181158 100644 --- a/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m +++ b/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m @@ -60,7 +60,7 @@ self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_new_password_placeholder", @"Vector", nil); self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_new_password_placeholder", @"Vector", nil); - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { // Apply placeholder color [self customizeViewRendering]; @@ -105,37 +105,37 @@ { [super customizeViewRendering]; - self.messageLabel.textColor = ThemeService.theme.textPrimaryColor; + self.messageLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.emailTextField.textColor = ThemeService.theme.textPrimaryColor; - self.passWordTextField.textColor = ThemeService.theme.textPrimaryColor; - self.repeatPasswordTextField.textColor = ThemeService.theme.textPrimaryColor; + self.emailTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.passWordTextField.textColor = ThemeService.shared.theme.textPrimaryColor; + self.repeatPasswordTextField.textColor = ThemeService.shared.theme.textPrimaryColor; self.messageLabel.numberOfLines = 0; [self.nextStepButton.layer setCornerRadius:5]; self.nextStepButton.clipsToBounds = YES; - self.nextStepButton.backgroundColor = ThemeService.theme.tintColor; + self.nextStepButton.backgroundColor = ThemeService.shared.theme.tintColor; - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { if (self.emailTextField.placeholder) { self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.emailTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } if (self.passWordTextField.placeholder) { self.passWordTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.passWordTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } if (self.repeatPasswordTextField.placeholder) { self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.repeatPasswordTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } } } diff --git a/Riot/Modules/Authentication/Views/TermsView.swift b/Riot/Modules/Authentication/Views/TermsView.swift index 154ac3b27..480e0416b 100644 --- a/Riot/Modules/Authentication/Views/TermsView.swift +++ b/Riot/Modules/Authentication/Views/TermsView.swift @@ -80,7 +80,7 @@ final class TermsView: UIView, NibOwnerLoadable, UITableViewDelegate, UITableVie } func customizeViewRendering() { - acceptButton.backgroundColor = ThemeService.theme().tintColor + acceptButton.backgroundColor = ThemeService.shared().theme.tintColor } diff --git a/Riot/Modules/BugReport/BugReportViewController.m b/Riot/Modules/BugReport/BugReportViewController.m index e6d9fe6ae..cbf17f7ec 100644 --- a/Riot/Modules/BugReport/BugReportViewController.m +++ b/Riot/Modules/BugReport/BugReportViewController.m @@ -138,36 +138,36 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.overlayView.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.overlayView.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; self.overlayView.alpha = 1.0; - self.containerView.backgroundColor = ThemeService.theme.backgroundColor; - self.sendingContainer.backgroundColor = ThemeService.theme.backgroundColor; + self.containerView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.sendingContainer.backgroundColor = ThemeService.shared.theme.backgroundColor; - self.bugReportDescriptionTextView.keyboardAppearance = ThemeService.theme.keyboardAppearance; + self.bugReportDescriptionTextView.keyboardAppearance = ThemeService.shared.theme.keyboardAppearance; - self.titleLabel.textColor = ThemeService.theme.textPrimaryColor; - self.sendingLabel.textColor = ThemeService.theme.textPrimaryColor; - self.descriptionLabel.textColor = ThemeService.theme.textPrimaryColor; - self.bugReportDescriptionTextView.textColor = ThemeService.theme.textPrimaryColor; - self.bugReportDescriptionTextView.tintColor = ThemeService.theme.tintColor; - self.logsDescriptionLabel.textColor = ThemeService.theme.textPrimaryColor; - self.sendLogsLabel.textColor = ThemeService.theme.textPrimaryColor; - self.sendScreenshotLabel.textColor = ThemeService.theme.textPrimaryColor; + self.titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.sendingLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.descriptionLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.bugReportDescriptionTextView.textColor = ThemeService.shared.theme.textPrimaryColor; + self.bugReportDescriptionTextView.tintColor = ThemeService.shared.theme.tintColor; + self.logsDescriptionLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.sendLogsLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.sendScreenshotLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.sendButton.tintColor = ThemeService.theme.tintColor; - self.cancelButton.tintColor = ThemeService.theme.tintColor; + self.sendButton.tintColor = ThemeService.shared.theme.tintColor; + self.cancelButton.tintColor = ThemeService.shared.theme.tintColor; - _bugReportDescriptionTextView.layer.borderColor = ThemeService.theme.headerBackgroundColor.CGColor; + _bugReportDescriptionTextView.layer.borderColor = ThemeService.shared.theme.headerBackgroundColor.CGColor; } - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy diff --git a/Riot/Modules/Call/CallViewController.m b/Riot/Modules/Call/CallViewController.m index 151160e01..7753347a8 100644 --- a/Riot/Modules/Call/CallViewController.m +++ b/Riot/Modules/Call/CallViewController.m @@ -98,20 +98,20 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.barTitleColor = ThemeService.theme.textPrimaryColor; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.barTitleColor = ThemeService.shared.theme.textPrimaryColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.callerNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.callStatusLabel.textColor = ThemeService.theme.baseTextSecondaryColor; + self.callerNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.callStatusLabel.textColor = ThemeService.shared.theme.baseTextSecondaryColor; - self.localPreviewContainerView.layer.borderColor = ThemeService.theme.tintColor.CGColor; + self.localPreviewContainerView.layer.borderColor = ThemeService.shared.theme.tintColor.CGColor; self.localPreviewContainerView.layer.borderWidth = 2; self.localPreviewContainerView.layer.cornerRadius = 5; self.localPreviewContainerView.clipsToBounds = YES; - self.remotePreviewContainerView.backgroundColor = ThemeService.theme.backgroundColor; + self.remotePreviewContainerView.backgroundColor = ThemeService.shared.theme.backgroundColor; if (gradientMaskLayer) { @@ -121,9 +121,9 @@ // Add a gradient mask programatically at the top of the screen (background of the call information (name, status)) gradientMaskLayer = [CAGradientLayer layer]; - // Consider the grayscale components of the ThemeService.theme.backgroundColor. + // Consider the grayscale components of the ThemeService.shared.theme.backgroundColor. CGFloat white = 1.0; - [ThemeService.theme.backgroundColor getWhite:&white alpha:nil]; + [ThemeService.shared.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; @@ -283,8 +283,8 @@ UINavigationController *usersDevicesNavigationController = [[RiotNavigationController alloc] init]; // Set Riot navigation bar colors - [ThemeService.theme applyStyleOnNavigationBar:usersDevicesNavigationController.navigationBar]; - usersDevicesNavigationController.navigationBar.barTintColor = ThemeService.theme.backgroundColor; + [ThemeService.shared.theme applyStyleOnNavigationBar:usersDevicesNavigationController.navigationBar]; + usersDevicesNavigationController.navigationBar.barTintColor = ThemeService.shared.theme.backgroundColor; [usersDevicesNavigationController pushViewController:usersDevicesViewController animated:NO]; @@ -350,7 +350,7 @@ } return [MXKTools paintImage:[UIImage imageNamed:@"placeholder"] - withColor:ThemeService.theme.tintColor]; + withColor:ThemeService.shared.theme.tintColor]; } - (void)setMxCall:(MXCall *)call diff --git a/Riot/Modules/Call/Views/IncomingCallView.m b/Riot/Modules/Call/Views/IncomingCallView.m index cfb038122..eb55551ac 100644 --- a/Riot/Modules/Call/Views/IncomingCallView.m +++ b/Riot/Modules/Call/Views/IncomingCallView.m @@ -57,11 +57,11 @@ static const CGFloat kButtonSize = 80.0; self = [super initWithFrame:CGRectZero]; if (self) { - self.backgroundColor = ThemeService.theme.backgroundColor; + self.backgroundColor = ThemeService.shared.theme.backgroundColor; self.opaque = YES; self.callerImageView = [[MXKImageView alloc] init]; - self.callerImageView.backgroundColor = ThemeService.theme.backgroundColor; + self.callerImageView.backgroundColor = ThemeService.shared.theme.backgroundColor; self.callerImageView.clipsToBounds = YES; self.callerImageView.mediaFolder = kMXMediaManagerAvatarThumbnailFolder; self.callerImageView.enableInMemoryCache = YES; @@ -74,28 +74,28 @@ static const CGFloat kButtonSize = 80.0; mediaManager:mediaManager]; self.callerNameLabel = [[UILabel alloc] init]; - self.callerNameLabel.backgroundColor = ThemeService.theme.backgroundColor; - self.callerNameLabel.textColor = ThemeService.theme.textPrimaryColor; + self.callerNameLabel.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.callerNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; self.callerNameLabel.font = [UIFont systemFontOfSize:24.0 weight:UIFontWeightMedium]; self.callerNameLabel.text = callerName; self.callerNameLabel.textAlignment = NSTextAlignmentCenter; self.callInfoLabel = [[UILabel alloc] init]; - self.callInfoLabel.backgroundColor = ThemeService.theme.backgroundColor; - self.callInfoLabel.textColor = ThemeService.theme.textSecondaryColor; + self.callInfoLabel.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.callInfoLabel.textColor = ThemeService.shared.theme.textSecondaryColor; self.callInfoLabel.font = [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]; self.callInfoLabel.text = callInfo; self.callInfoLabel.textAlignment = NSTextAlignmentCenter; - UIColor *answerButtonBorderColor = ThemeService.theme.tintColor; + UIColor *answerButtonBorderColor = ThemeService.shared.theme.tintColor; self.answerButton = [[CircleButton alloc] initWithImage:[UIImage imageNamed:@"voice_call_icon"] borderColor:answerButtonBorderColor]; - self.answerButton.defaultBackgroundColor = ThemeService.theme.backgroundColor; + self.answerButton.defaultBackgroundColor = ThemeService.shared.theme.backgroundColor; [self.answerButton addTarget:self action:@selector(didTapAnswerButton) forControlEvents:UIControlEventTouchUpInside]; self.answerTitleLabel = [[UILabel alloc] init]; - self.answerTitleLabel.backgroundColor = ThemeService.theme.backgroundColor; + self.answerTitleLabel.backgroundColor = ThemeService.shared.theme.backgroundColor; self.answerTitleLabel.textColor = answerButtonBorderColor; self.answerTitleLabel.font = [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]; self.answerTitleLabel.text = NSLocalizedStringFromTable(@"accept", @"Vector", nil); @@ -104,11 +104,11 @@ static const CGFloat kButtonSize = 80.0; self.rejectButton = [[CircleButton alloc] initWithImage:[UIImage imageNamed:@"call_hangup_icon"] borderColor:rejectButtonBorderColor]; - self.rejectButton.defaultBackgroundColor = ThemeService.theme.backgroundColor; + self.rejectButton.defaultBackgroundColor = ThemeService.shared.theme.backgroundColor; [self.rejectButton addTarget:self action:@selector(didTapRejectButton) forControlEvents:UIControlEventTouchUpInside]; self.rejectTitleLabel = [[UILabel alloc] init]; - self.rejectTitleLabel.backgroundColor = ThemeService.theme.backgroundColor; + self.rejectTitleLabel.backgroundColor = ThemeService.shared.theme.backgroundColor; self.rejectTitleLabel.textColor = rejectButtonBorderColor; self.rejectTitleLabel.font = [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]; self.rejectTitleLabel.text = NSLocalizedStringFromTable(@"decline", @"Vector", nil); diff --git a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m index ee608cae2..9f8472f13 100644 --- a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m +++ b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m @@ -415,10 +415,10 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou NSString *roomCount = [NSString stringWithFormat:@" %tu", count]; NSMutableAttributedString *mutableSectionTitle = [[NSMutableAttributedString alloc] initWithString:title - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.headerTextPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.headerTextPrimaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0]}]; [mutableSectionTitle appendAttributedString:[[NSMutableAttributedString alloc] initWithString:roomCount - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.headerTextSecondaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.headerTextSecondaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0]}]]; sectionTitle = mutableSectionTitle; @@ -426,7 +426,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou else if (title) { sectionTitle = [[NSAttributedString alloc] initWithString:title - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.headerTextPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.headerTextPrimaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0]}]; } @@ -469,7 +469,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou if (count) { UILabel *missedNotifAndUnreadBadgeLabel = [[UILabel alloc] init]; - missedNotifAndUnreadBadgeLabel.textColor = ThemeService.theme.backgroundColor; + missedNotifAndUnreadBadgeLabel.textColor = ThemeService.shared.theme.backgroundColor; missedNotifAndUnreadBadgeLabel.font = [UIFont boldSystemFontOfSize:14]; if (count > 1000) { @@ -487,7 +487,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou missedNotifAndUnreadBadgeBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, bgViewWidth, 20)]; [missedNotifAndUnreadBadgeBgView.layer setCornerRadius:10]; - missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.theme.headerTextSecondaryColor; + missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.headerTextSecondaryColor; [missedNotifAndUnreadBadgeBgView addSubview:missedNotifAndUnreadBadgeLabel]; missedNotifAndUnreadBadgeLabel.center = missedNotifAndUnreadBadgeBgView.center; @@ -516,7 +516,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou - (UIView *)viewForHeaderInSection:(NSInteger)section withFrame:(CGRect)frame { UIView *sectionHeader = [[UIView alloc] initWithFrame:frame]; - sectionHeader.backgroundColor = ThemeService.theme.headerBackgroundColor; + sectionHeader.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; NSInteger sectionBitwise = 0; UIImageView *chevronView; UIView *accessoryView; @@ -754,8 +754,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou } // Apply the current UI theme. - networkLabel.textColor = ThemeService.theme.textPrimaryColor; - directoryServerLabel.textColor = ThemeService.theme.textSecondaryColor; + networkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + directoryServerLabel.textColor = ThemeService.shared.theme.textSecondaryColor; // Set the current directory server name directoryServerLabel.text = _publicRoomsDirectoryDataSource.directoryServerDisplayname; @@ -846,7 +846,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou if (!tableViewCell) { tableViewCell = [[MXKTableViewCell alloc] init]; - tableViewCell.textLabel.textColor = ThemeService.theme.textSecondaryColor; + tableViewCell.textLabel.textColor = ThemeService.shared.theme.textSecondaryColor; tableViewCell.textLabel.font = [UIFont systemFontOfSize:15.0]; tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone; } diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 23e085a44..3f4b6ae3a 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -159,17 +159,17 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Use the primary bg color for the recents table view in plain style. - self.recentsTableView.backgroundColor = ThemeService.theme.backgroundColor; - topview.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.view.backgroundColor = ThemeService.theme.backgroundColor; + self.recentsTableView.backgroundColor = ThemeService.shared.theme.backgroundColor; + topview.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; - [ThemeService.theme applyStyleOnSearchBar:tableSearchBar]; - [ThemeService.theme applyStyleOnSearchBar:self.recentsSearchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:tableSearchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:self.recentsSearchBar]; if (self.recentsTableView.dataSource) { @@ -180,7 +180,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -868,7 +868,7 @@ }]; UIImage *actionIcon = isDirect ? [UIImage imageNamed:@"directChatOff"] : [UIImage imageNamed:@"directChatOn"]; - directAction.backgroundColor = [MXKTools convertImageToPatternColor:isDirect ? @"directChatOff" : @"directChatOn" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + directAction.backgroundColor = [MXKTools convertImageToPatternColor:isDirect ? @"directChatOff" : @"directChatOn" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:directAction atIndex:0]; @@ -882,7 +882,7 @@ }]; actionIcon = isMuted ? [UIImage imageNamed:@"notifications"] : [UIImage imageNamed:@"notificationsOff"]; - muteAction.backgroundColor = [MXKTools convertImageToPatternColor:isMuted ? @"notifications" : @"notificationsOff" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + muteAction.backgroundColor = [MXKTools convertImageToPatternColor:isMuted ? @"notifications" : @"notificationsOff" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:muteAction atIndex:0]; // Favorites management @@ -907,7 +907,7 @@ }]; actionIcon = [UIImage imageNamed:@"favouriteOff"]; - action.backgroundColor = [MXKTools convertImageToPatternColor:@"favouriteOff" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + action.backgroundColor = [MXKTools convertImageToPatternColor:@"favouriteOff" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:action atIndex:0]; } else @@ -919,7 +919,7 @@ }]; actionIcon = [UIImage imageNamed:@"favourite"]; - action.backgroundColor = [MXKTools convertImageToPatternColor:@"favourite" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + action.backgroundColor = [MXKTools convertImageToPatternColor:@"favourite" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:action atIndex:0]; } @@ -932,7 +932,7 @@ }]; actionIcon = [UIImage imageNamed:@"priorityHigh"]; - action.backgroundColor = [MXKTools convertImageToPatternColor:@"priorityHigh" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + action.backgroundColor = [MXKTools convertImageToPatternColor:@"priorityHigh" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:action atIndex:0]; } else @@ -944,7 +944,7 @@ }]; actionIcon = [UIImage imageNamed:@"priorityLow"]; - action.backgroundColor = [MXKTools convertImageToPatternColor:@"priorityLow" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + action.backgroundColor = [MXKTools convertImageToPatternColor:@"priorityLow" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:action atIndex:0]; } @@ -955,7 +955,7 @@ }]; actionIcon = [UIImage imageNamed:@"leave"]; - leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"leave" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; + leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"leave" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:actionIcon.size]; [actions insertObject:leaveAction atIndex:0]; } @@ -1185,13 +1185,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -1413,7 +1413,7 @@ if (indexPath && [recentsDataSource isDraggableCellAt:indexPath]) { UITableViewCell *cell = [self.recentsTableView cellForRowAtIndexPath:indexPath]; - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // snapshot the cell UIGraphicsBeginImageContextWithOptions(cell.bounds.size, NO, 0); diff --git a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m index 4703015d4..368246820 100644 --- a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m +++ b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m @@ -48,13 +48,13 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; { [super customizeTableViewCellRendering]; - self.roomTitle.textColor = ThemeService.theme.textPrimaryColor; - self.lastEventDescription.textColor = ThemeService.theme.textSecondaryColor; - self.lastEventDate.textColor = ThemeService.theme.textSecondaryColor; - self.missedNotifAndUnreadBadgeLabel.textColor = ThemeService.theme.backgroundColor; + self.roomTitle.textColor = ThemeService.shared.theme.textPrimaryColor; + self.lastEventDescription.textColor = ThemeService.shared.theme.textSecondaryColor; + self.lastEventDate.textColor = ThemeService.shared.theme.textSecondaryColor; + self.missedNotifAndUnreadBadgeLabel.textColor = ThemeService.shared.theme.backgroundColor; // Prepare direct room border - CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(ThemeService.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); + CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(ThemeService.shared.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); [self.directRoomBorderView.layer setCornerRadius:self.directRoomBorderView.frame.size.width / 2]; self.directRoomBorderView.clipsToBounds = YES; @@ -94,7 +94,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; { // Force the default text color for the last message (cancel highlighted message color) NSMutableAttributedString *lastEventDescription = [[NSMutableAttributedString alloc] initWithAttributedString:roomCellData.lastEventAttributedTextMessage]; - [lastEventDescription addAttribute:NSForegroundColorAttributeName value:ThemeService.theme.textSecondaryColor range:NSMakeRange(0, lastEventDescription.length)]; + [lastEventDescription addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.textSecondaryColor range:NSMakeRange(0, lastEventDescription.length)]; self.lastEventDescription.attributedText = lastEventDescription; } else @@ -109,7 +109,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; if (0 < roomCellData.notificationCount) { - self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.theme.notificationMentionColor : ThemeService.theme.notificationUnreadColor; + self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.notificationMentionColor : ThemeService.shared.theme.notificationUnreadColor; self.missedNotifAndUnreadBadgeBgView.hidden = NO; self.missedNotifAndUnreadBadgeBgView.backgroundColor = self.missedNotifAndUnreadIndicator.backgroundColor; @@ -121,7 +121,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; } else { - self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.theme.headerTextSecondaryColor; + self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.shared.theme.headerTextSecondaryColor; } // Use bold font for the room title @@ -136,7 +136,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; } else { - self.lastEventDate.textColor = ThemeService.theme.textSecondaryColor; + self.lastEventDate.textColor = ThemeService.shared.theme.textSecondaryColor; // The room title is not bold anymore if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) diff --git a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.h b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.h index 53f5966d1..f68d498ae 100644 --- a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.h +++ b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.h @@ -38,7 +38,7 @@ limitations under the License. @property (nonatomic) NSUInteger selectedIndex; /** - The tint color for the section header (ThemeService.theme.accent by default). + The tint color for the section header (ThemeService.shared.theme.accent by default). */ @property (nonatomic) UIColor *sectionHeaderTintColor; diff --git a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m index ae281daff..b992f663e 100644 --- a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m +++ b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m @@ -136,7 +136,7 @@ // Setup `MXKViewControllerHandling` properties self.enableBarTintColorStatusChange = NO; - self.sectionHeaderTintColor = ThemeService.theme.tintColor; + self.sectionHeaderTintColor = ThemeService.shared.theme.tintColor; } - (void)viewDidLoad @@ -178,16 +178,16 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.view.backgroundColor = ThemeService.theme.backgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)viewWillAppear:(BOOL)animated diff --git a/Riot/Modules/Common/WebViewController/WebViewViewController.m b/Riot/Modules/Common/WebViewController/WebViewViewController.m index e60a7b371..14426ff8c 100644 --- a/Riot/Modules/Common/WebViewController/WebViewViewController.m +++ b/Riot/Modules/Common/WebViewController/WebViewViewController.m @@ -52,16 +52,16 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - webView.backgroundColor = ThemeService.theme.backgroundColor; + webView.backgroundColor = ThemeService.shared.theme.backgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy diff --git a/Riot/Modules/Communities/GroupsViewController.m b/Riot/Modules/Communities/GroupsViewController.m index 159fab7a8..a59dfe849 100644 --- a/Riot/Modules/Communities/GroupsViewController.m +++ b/Riot/Modules/Communities/GroupsViewController.m @@ -116,17 +116,17 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Use the primary bg color for the recents table view in plain style. - self.groupsTableView.backgroundColor = ThemeService.theme.backgroundColor; - topview.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.view.backgroundColor = ThemeService.theme.backgroundColor; + self.groupsTableView.backgroundColor = ThemeService.shared.theme.backgroundColor; + topview.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; - [ThemeService.theme applyStyleOnSearchBar:tableSearchBar]; - [ThemeService.theme applyStyleOnSearchBar:self.groupsSearchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:tableSearchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:self.groupsSearchBar]; if (self.groupsTableView.dataSource) { @@ -137,7 +137,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -424,13 +424,13 @@ { [super tableView:tableView willDisplayCell:cell forRowAtIndexPath:indexPath]; - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -452,8 +452,8 @@ if (tableView.numberOfSections > 1) { sectionHeader = [tableView dequeueReusableHeaderFooterViewWithIdentifier:MXKTableViewHeaderFooterWithLabel.defaultReuseIdentifier]; - sectionHeader.mxkContentView.backgroundColor = ThemeService.theme.headerBackgroundColor; - sectionHeader.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + sectionHeader.mxkContentView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + sectionHeader.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; sectionHeader.mxkLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; NSString* title = [self.dataSource tableView:tableView titleForHeaderInSection:section]; @@ -462,9 +462,9 @@ { NSString *roomCount = [NSString stringWithFormat:@" %tu", count]; NSMutableAttributedString *mutableSectionTitle = [[NSMutableAttributedString alloc] initWithString:title - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.headerTextPrimaryColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.headerTextPrimaryColor}]; [mutableSectionTitle appendAttributedString:[[NSMutableAttributedString alloc] initWithString:roomCount - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.headerTextSecondaryColor}]]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.headerTextSecondaryColor}]]; sectionHeader.mxkLabel.attributedText = mutableSectionTitle; } @@ -512,7 +512,7 @@ }]; - leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_blue" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; + leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_blue" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:leaveAction atIndex:0]; } diff --git a/Riot/Modules/Communities/Home/GroupHomeViewController.m b/Riot/Modules/Communities/Home/GroupHomeViewController.m index ea7d2a04d..42cbe7505 100644 --- a/Riot/Modules/Communities/Home/GroupHomeViewController.m +++ b/Riot/Modules/Communities/Home/GroupHomeViewController.m @@ -113,22 +113,22 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.view.backgroundColor = ThemeService.theme.backgroundColor; - self.mainHeaderContainer.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.mainHeaderContainer.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; - _groupName.textColor = ThemeService.theme.textPrimaryColor; + _groupName.textColor = ThemeService.shared.theme.textPrimaryColor; - _groupDescription.textColor = ThemeService.theme.baseTextSecondaryColor; + _groupDescription.textColor = ThemeService.shared.theme.baseTextSecondaryColor; _groupDescription.numberOfLines = 0; - self.inviteLabel.textColor = ThemeService.theme.baseTextSecondaryColor; + self.inviteLabel.textColor = ThemeService.shared.theme.baseTextSecondaryColor; self.inviteLabel.numberOfLines = 0; - self.separatorView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.separatorView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; [self.leftButton.layer setCornerRadius:5]; self.leftButton.clipsToBounds = YES; @@ -140,11 +140,11 @@ if (_groupLongDescription) { - _groupLongDescription.textColor = ThemeService.theme.textSecondaryColor; + _groupLongDescription.textColor = ThemeService.shared.theme.textSecondaryColor; _groupLongDescription.tintColor = kRiotColorBlue; // Update HTML loading options - NSUInteger bgColor = [MXKTools rgbValueWithColor:ThemeService.theme.headerBackgroundColor]; + NSUInteger bgColor = [MXKTools rgbValueWithColor:ThemeService.shared.theme.headerBackgroundColor]; NSString *defaultCSS = [NSString stringWithFormat:@" \ pre,code { \ background-color: #%06lX; \ @@ -170,7 +170,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (BOOL)prefersStatusBarHidden @@ -481,7 +481,7 @@ _groupAvatar.layer.cornerRadius = _groupAvatar.frame.size.width / 2; _groupAvatar.clipsToBounds = YES; - _groupAvatar.defaultBackgroundColor = ThemeService.theme.headerBackgroundColor; + _groupAvatar.defaultBackgroundColor = ThemeService.shared.theme.headerBackgroundColor; } - (void)refreshGroupLongDescription diff --git a/Riot/Modules/Communities/Members/GroupParticipantsViewController.m b/Riot/Modules/Communities/Members/GroupParticipantsViewController.m index 157e2ff2c..db0ab6aaf 100644 --- a/Riot/Modules/Communities/Members/GroupParticipantsViewController.m +++ b/Riot/Modules/Communities/Members/GroupParticipantsViewController.m @@ -145,21 +145,21 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; [self refreshSearchBarItemsColor:_searchBarView]; - _searchBarHeaderBorder.backgroundColor = ThemeService.theme.headerBorderColor; + _searchBarHeaderBorder.backgroundColor = ThemeService.shared.theme.headerBorderColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; // Update the gradient view above the screen CGFloat white = 1.0; - [ThemeService.theme.backgroundColor getWhite:&white alpha:nil]; + [ThemeService.shared.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; tableViewMaskLayer.colors = @[(__bridge id) transparentWhiteColor, (__bridge id) transparentWhiteColor, (__bridge id) opaqueWhiteColor]; @@ -172,7 +172,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } // This method is called when the viewcontroller is added or removed from a container view controller. @@ -444,9 +444,9 @@ // Add blur mask programmatically tableViewMaskLayer = [CAGradientLayer layer]; - // Consider the grayscale components of the ThemeService.theme.backgroundColor. + // Consider the grayscale components of the ThemeService.shared.theme.backgroundColor. CGFloat white = 1.0; - [ThemeService.theme.backgroundColor getWhite:&white alpha:nil]; + [ThemeService.shared.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; @@ -877,13 +877,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -914,8 +914,8 @@ if (section == invitedSection) { sectionHeader = [tableView dequeueReusableHeaderFooterViewWithIdentifier:MXKTableViewHeaderFooterWithLabel.defaultReuseIdentifier]; - sectionHeader.mxkContentView.backgroundColor = ThemeService.theme.headerBackgroundColor; - sectionHeader.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + sectionHeader.mxkContentView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + sectionHeader.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; sectionHeader.mxkLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; sectionHeader.mxkLabel.text = NSLocalizedStringFromTable(@"group_participants_invited_section", @"Vector", nil); @@ -985,7 +985,7 @@ }]; - leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_blue" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; + leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_blue" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:leaveAction atIndex:0]; } @@ -1205,7 +1205,7 @@ // text color UITextField *searchBarTextField = [searchBar valueForKey:@"_searchField"]; - searchBarTextField.textColor = ThemeService.theme.textSecondaryColor; + searchBarTextField.textColor = ThemeService.shared.theme.textSecondaryColor; // Magnifying glass icon. UIImageView *leftImageView = (UIImageView *)searchBarTextField.leftView; diff --git a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m index 93efa76ce..8216249b4 100644 --- a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m +++ b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m @@ -126,16 +126,16 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; [self refreshSearchBarItemsColor:_searchBarView]; - _searchBarHeaderBorder.backgroundColor = ThemeService.theme.headerBorderColor; + _searchBarHeaderBorder.backgroundColor = ThemeService.shared.theme.headerBorderColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -146,7 +146,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } // This method is called when the viewcontroller is added or removed from a container view controller. @@ -487,13 +487,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -588,7 +588,7 @@ // // }]; // -// leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_blue" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; +// leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_blue" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; // [actions insertObject:leaveAction atIndex:0]; // // return actions; @@ -606,7 +606,7 @@ // text color UITextField *searchBarTextField = [searchBar valueForKey:@"_searchField"]; - searchBarTextField.textColor = ThemeService.theme.textSecondaryColor; + searchBarTextField.textColor = ThemeService.shared.theme.textSecondaryColor; // Magnifying glass icon. UIImageView *leftImageView = (UIImageView *)searchBarTextField.leftView; diff --git a/Riot/Modules/Communities/Rooms/Views/GroupRoomTableViewCell.m b/Riot/Modules/Communities/Rooms/Views/GroupRoomTableViewCell.m index 334f16395..0f11758c8 100644 --- a/Riot/Modules/Communities/Rooms/Views/GroupRoomTableViewCell.m +++ b/Riot/Modules/Communities/Rooms/Views/GroupRoomTableViewCell.m @@ -37,8 +37,8 @@ { [super customizeTableViewCellRendering]; - self.roomDisplayName.textColor = ThemeService.theme.textPrimaryColor; - self.roomTopic.textColor = ThemeService.theme.textSecondaryColor; + self.roomDisplayName.textColor = ThemeService.shared.theme.textPrimaryColor; + self.roomTopic.textColor = ThemeService.shared.theme.textSecondaryColor; _roomAvatar.defaultBackgroundColor = [UIColor clearColor]; } diff --git a/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.m b/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.m index c6c6902cf..78d5fa770 100644 --- a/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.m +++ b/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.m @@ -122,7 +122,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (BOOL)prefersStatusBarHidden diff --git a/Riot/Modules/Communities/Views/GroupInviteTableViewCell.m b/Riot/Modules/Communities/Views/GroupInviteTableViewCell.m index 5c9985455..76fff5045 100644 --- a/Riot/Modules/Communities/Views/GroupInviteTableViewCell.m +++ b/Riot/Modules/Communities/Views/GroupInviteTableViewCell.m @@ -58,7 +58,7 @@ NSString *const kGroupInviteTableViewCellRoomKey = @"kGroupInviteTableViewCellRo self.leftButton.backgroundColor = kRiotColorBlue; self.rightButton.backgroundColor = kRiotColorBlue; - self.noticeBadgeView.backgroundColor = ThemeService.theme.notificationMentionColor; + self.noticeBadgeView.backgroundColor = ThemeService.shared.theme.notificationMentionColor; } - (void)onDeclinePressed:(id)sender diff --git a/Riot/Modules/Communities/Views/GroupTableViewCell.m b/Riot/Modules/Communities/Views/GroupTableViewCell.m index ef8e7b0e7..a8d197120 100644 --- a/Riot/Modules/Communities/Views/GroupTableViewCell.m +++ b/Riot/Modules/Communities/Views/GroupTableViewCell.m @@ -41,13 +41,13 @@ { [super customizeTableViewCellRendering]; - self.groupName.textColor = ThemeService.theme.textPrimaryColor; - self.groupDescription.textColor = ThemeService.theme.textSecondaryColor; - self.memberCount.textColor = ThemeService.theme.textSecondaryColor; + self.groupName.textColor = ThemeService.shared.theme.textPrimaryColor; + self.groupDescription.textColor = ThemeService.shared.theme.textSecondaryColor; + self.memberCount.textColor = ThemeService.shared.theme.textSecondaryColor; if (self.missedNotifAndUnreadBadgeLabel) { - self.missedNotifAndUnreadBadgeLabel.textColor = ThemeService.theme.backgroundColor; + self.missedNotifAndUnreadBadgeLabel.textColor = ThemeService.shared.theme.backgroundColor; } self.groupAvatar.defaultBackgroundColor = [UIColor clearColor]; diff --git a/Riot/Modules/Contacts/ContactsTableViewController.m b/Riot/Modules/Contacts/ContactsTableViewController.m index 2943ae0d2..558813569 100644 --- a/Riot/Modules/Contacts/ContactsTableViewController.m +++ b/Riot/Modules/Contacts/ContactsTableViewController.m @@ -104,12 +104,12 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.contactsTableView.backgroundColor; if (self.contactsTableView.dataSource) @@ -120,7 +120,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)didReceiveMemoryWarning @@ -288,13 +288,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Contacts/DataSources/ContactsDataSource.m b/Riot/Modules/Contacts/DataSources/ContactsDataSource.m index 43c1bc86f..c77685d09 100644 --- a/Riot/Modules/Contacts/DataSources/ContactsDataSource.m +++ b/Riot/Modules/Contacts/DataSources/ContactsDataSource.m @@ -595,7 +595,7 @@ if (!tableViewCell) { tableViewCell = [[MXKTableViewCell alloc] init]; - tableViewCell.textLabel.textColor = ThemeService.theme.textSecondaryColor; + tableViewCell.textLabel.textColor = ThemeService.shared.theme.textSecondaryColor; tableViewCell.textLabel.font = [UIFont systemFontOfSize:15.0]; tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone; } @@ -742,10 +742,10 @@ NSString *roomCount = [NSString stringWithFormat:roomCountFormat, count]; NSMutableAttributedString *mutableSectionTitle = [[NSMutableAttributedString alloc] initWithString:title - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.headerTextPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.headerTextPrimaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0]}]; [mutableSectionTitle appendAttributedString:[[NSMutableAttributedString alloc] initWithString:roomCount - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.headerTextSecondaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.headerTextSecondaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0]}]]; sectionTitle = mutableSectionTitle; @@ -753,7 +753,7 @@ else if (title) { sectionTitle = [[NSAttributedString alloc] initWithString:title - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.headerTextPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.headerTextPrimaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0]}]; } @@ -767,7 +767,7 @@ NSInteger sectionBitwise = 0; sectionHeader = [[UIView alloc] initWithFrame:frame]; - sectionHeader.backgroundColor = ThemeService.theme.headerBackgroundColor; + sectionHeader.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; frame.origin.x = 20; frame.origin.y = 5; @@ -970,7 +970,7 @@ } // Apply UI theme - checkboxLabel.textColor = ThemeService.theme.textPrimaryColor; + checkboxLabel.textColor = ThemeService.shared.theme.textPrimaryColor; // Set the right value of the tick box localContactsCheckbox.image = hideNonMatrixEnabledContacts ? [UIImage imageNamed:@"selection_tick"] : [UIImage imageNamed:@"selection_untick"]; diff --git a/Riot/Modules/Contacts/Details/ContactDetailsViewController.m b/Riot/Modules/Contacts/Details/ContactDetailsViewController.m index 5a7aaab2f..dedcb530a 100644 --- a/Riot/Modules/Contacts/Details/ContactDetailsViewController.m +++ b/Riot/Modules/Contacts/Details/ContactDetailsViewController.m @@ -231,16 +231,16 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.headerView.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.contactNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.contactStatusLabel.textColor = ThemeService.theme.tintColor; + self.headerView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.contactNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.contactStatusLabel.textColor = ThemeService.shared.theme.tintColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -251,7 +251,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (BOOL)prefersStatusBarHidden @@ -735,8 +735,8 @@ [cellWithButton.mxkButton setTitle:title forState:UIControlStateNormal]; [cellWithButton.mxkButton setTitle:title forState:UIControlStateHighlighted]; - [cellWithButton.mxkButton setTitleColor:ThemeService.theme.textPrimaryColor forState:UIControlStateNormal]; - [cellWithButton.mxkButton setTitleColor:ThemeService.theme.textPrimaryColor forState:UIControlStateHighlighted]; + [cellWithButton.mxkButton setTitleColor:ThemeService.shared.theme.textPrimaryColor forState:UIControlStateNormal]; + [cellWithButton.mxkButton setTitleColor:ThemeService.shared.theme.textPrimaryColor forState:UIControlStateHighlighted]; [cellWithButton.mxkButton addTarget:self action:@selector(onActionButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; @@ -779,13 +779,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Contacts/Details/Views/RoomTableViewCell.m b/Riot/Modules/Contacts/Details/Views/RoomTableViewCell.m index c9d6b5260..f715c5391 100644 --- a/Riot/Modules/Contacts/Details/Views/RoomTableViewCell.m +++ b/Riot/Modules/Contacts/Details/Views/RoomTableViewCell.m @@ -35,10 +35,10 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; { [super customizeTableViewCellRendering]; - self.titleLabel.textColor = ThemeService.theme.textPrimaryColor; + self.titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor; // Prepare direct room border - CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(ThemeService.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); + CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(ThemeService.shared.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); [self.directRoomBorderView.layer setCornerRadius:self.directRoomBorderView.frame.size.width / 2]; self.directRoomBorderView.clipsToBounds = YES; diff --git a/Riot/Modules/Contacts/Views/ContactTableViewCell.m b/Riot/Modules/Contacts/Views/ContactTableViewCell.m index ae7306b37..f55ce88e9 100644 --- a/Riot/Modules/Contacts/Views/ContactTableViewCell.m +++ b/Riot/Modules/Contacts/Views/ContactTableViewCell.m @@ -53,8 +53,8 @@ [super customizeTableViewCellRendering]; // apply the vector colours - self.contactDisplayNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.contactInformationLabel.textColor = ThemeService.theme.textSecondaryColor; + self.contactDisplayNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.contactInformationLabel.textColor = ThemeService.shared.theme.textSecondaryColor; // Clear the default background color of a MXKImageView instance self.thumbnailView.defaultBackgroundColor = [UIColor clearColor]; @@ -223,11 +223,11 @@ } else if ((!contact.isMatrixContact && contact.phoneNumbers.count && !contact.emailAddresses.count)) { - image = [AvatarGenerator imageFromText:@"#" withBackgroundColor:ThemeService.theme.tintColor]; + image = [AvatarGenerator imageFromText:@"#" withBackgroundColor:ThemeService.shared.theme.tintColor]; } else { - image = [AvatarGenerator imageFromText:@"@" withBackgroundColor:ThemeService.theme.tintColor]; + image = [AvatarGenerator imageFromText:@"@" withBackgroundColor:ThemeService.shared.theme.tintColor]; } } diff --git a/Riot/Modules/EncryptionInfo/EncryptionInfoView.m b/Riot/Modules/EncryptionInfo/EncryptionInfoView.m index 78851ffd7..bcc35656e 100644 --- a/Riot/Modules/EncryptionInfo/EncryptionInfoView.m +++ b/Riot/Modules/EncryptionInfo/EncryptionInfoView.m @@ -28,13 +28,13 @@ { [super customizeViewRendering]; - self.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.textView.backgroundColor = ThemeService.theme.backgroundColor; - self.defaultTextColor = ThemeService.theme.textPrimaryColor; - self.cancelButton.tintColor = ThemeService.theme.tintColor; - self.verifyButton.tintColor = ThemeService.theme.tintColor; - self.blockButton.tintColor = ThemeService.theme.tintColor; - self.confirmVerifyButton.tintColor = ThemeService.theme.tintColor; + self.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.textView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.defaultTextColor = ThemeService.shared.theme.textPrimaryColor; + self.cancelButton.tintColor = ThemeService.shared.theme.tintColor; + self.verifyButton.tintColor = ThemeService.shared.theme.tintColor; + self.blockButton.tintColor = ThemeService.shared.theme.tintColor; + self.confirmVerifyButton.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m b/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m index 6c35be7c2..612297f11 100644 --- a/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m +++ b/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m @@ -71,15 +71,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = ThemeService.theme.backgroundColor; + self.noResultsLabel.textColor = ThemeService.shared.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -89,7 +89,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -153,13 +153,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m b/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m index 9152118a8..b853631cd 100644 --- a/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m +++ b/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m @@ -28,11 +28,11 @@ { [super customizeTableViewCellRendering]; - self.title.textColor = ThemeService.theme.textPrimaryColor; + self.title.textColor = ThemeService.shared.theme.textPrimaryColor; - self.message.textColor = ThemeService.theme.textSecondaryColor; + self.message.textColor = ThemeService.shared.theme.textSecondaryColor; - self.date.tintColor = ThemeService.theme.textSecondaryColor; + self.date.tintColor = ThemeService.shared.theme.textSecondaryColor; } + (CGFloat)heightForCellData:(MXKCellData *)cellData withMaximumWidth:(CGFloat)maxWidth @@ -76,7 +76,7 @@ if (bubbleData.isAttachmentWithThumbnail) { - self.attachmentImageView.backgroundColor = ThemeService.theme.backgroundColor; + self.attachmentImageView.backgroundColor = ThemeService.shared.theme.backgroundColor; [self.attachmentImageView setAttachmentThumb:bubbleData.attachment]; } diff --git a/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m b/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m index cd26647d1..4c69eab0f 100644 --- a/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m +++ b/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m @@ -66,7 +66,7 @@ if (cellData) { // Highlight the search pattern - [cellData highlightPatternInTextMessage:self.searchText withForegroundColor:ThemeService.theme.tintColor andFont:patternFont]; + [cellData highlightPatternInTextMessage:self.searchText withForegroundColor:ThemeService.shared.theme.tintColor andFont:patternFont]; // Use profile information as data to display MXSearchUserProfile *userProfile = result.context.profileInfo[result.result.sender]; diff --git a/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m b/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m index 6d51eeadc..dc55572a9 100644 --- a/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m +++ b/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m @@ -78,15 +78,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = ThemeService.theme.backgroundColor; + self.noResultsLabel.textColor = ThemeService.shared.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -96,7 +96,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -196,13 +196,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultAttachmentBubbleCell.m b/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultAttachmentBubbleCell.m index fc2ced745..2423473ed 100644 --- a/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultAttachmentBubbleCell.m +++ b/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultAttachmentBubbleCell.m @@ -26,11 +26,11 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.roomNameLabel.textColor = ThemeService.theme.textSecondaryColor; + self.roomNameLabel.textColor = ThemeService.shared.theme.textSecondaryColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultTextMsgBubbleCell.m b/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultTextMsgBubbleCell.m index 41c3f7c76..ea0e14502 100644 --- a/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultTextMsgBubbleCell.m +++ b/Riot/Modules/GlobalSearch/Messages/Views/MessagesSearchResultTextMsgBubbleCell.m @@ -26,11 +26,11 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.roomNameLabel.textColor = ThemeService.theme.textSecondaryColor; + self.roomNameLabel.textColor = ThemeService.shared.theme.textSecondaryColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m b/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m index 20e1886d0..d4c420694 100644 --- a/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m +++ b/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m @@ -71,12 +71,12 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -87,7 +87,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -157,13 +157,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m index fb91a4a33..5713ca837 100644 --- a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m +++ b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m @@ -115,7 +115,7 @@ UIImageView *backgroundImageView = self.backgroundImageView; if (backgroundImageView) { - UIImage *image = [MXKTools paintImage:backgroundImageView.image withColor:ThemeService.theme.matrixSearchBackgroundImageTintColor]; + UIImage *image = [MXKTools paintImage:backgroundImageView.image withColor:ThemeService.shared.theme.matrixSearchBackgroundImageTintColor]; backgroundImageView.image = image; } } diff --git a/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m b/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m index fa243ac3a..0ebf282f1 100644 --- a/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m +++ b/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m @@ -30,8 +30,8 @@ { [super customizeTableViewCellRendering]; - self.titleLabel.textColor = ThemeService.theme.textPrimaryColor; - self.descriptionLabel.textColor = ThemeService.theme.textSecondaryColor; + self.titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.descriptionLabel.textColor = ThemeService.shared.theme.textSecondaryColor; } - (void)render:(PublicRoomsDirectoryDataSource *)publicRoomsDirectoryDataSource diff --git a/Riot/Modules/GlobalSearch/Views/RoomIdOrAliasTableViewCell.m b/Riot/Modules/GlobalSearch/Views/RoomIdOrAliasTableViewCell.m index 09a2f0a58..44f788e91 100644 --- a/Riot/Modules/GlobalSearch/Views/RoomIdOrAliasTableViewCell.m +++ b/Riot/Modules/GlobalSearch/Views/RoomIdOrAliasTableViewCell.m @@ -29,7 +29,7 @@ { [super customizeTableViewCellRendering]; - self.titleLabel.textColor = ThemeService.theme.textPrimaryColor; + self.titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor; } - (void)layoutSubviews @@ -50,7 +50,7 @@ else { self.avatarImageView.image = [MXKTools paintImage:[UIImage imageNamed:@"placeholder"] - withColor:ThemeService.theme.tintColor]; + withColor:ThemeService.shared.theme.tintColor]; } self.titleLabel.text = roomIdOrAlias; diff --git a/Riot/Modules/Home/HomeViewController.m b/Riot/Modules/Home/HomeViewController.m index ae9b731ee..b8873d2b9 100644 --- a/Riot/Modules/Home/HomeViewController.m +++ b/Riot/Modules/Home/HomeViewController.m @@ -82,9 +82,9 @@ [AppDelegate theDelegate].masterTabBarController.navigationItem.title = NSLocalizedStringFromTable(@"title_home", @"Vector", nil); - [ThemeService.theme applyStyleOnNavigationBar:[AppDelegate theDelegate].masterTabBarController.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:[AppDelegate theDelegate].masterTabBarController.navigationController.navigationBar]; - [AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.theme.tintColor; + [AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.shared.theme.tintColor; if (recentsDataSource) { @@ -416,7 +416,7 @@ } } - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; return cell; } diff --git a/Riot/Modules/Home/Views/RoomCollectionViewCell.m b/Riot/Modules/Home/Views/RoomCollectionViewCell.m index 5bd5cc385..a9ccbd35f 100644 --- a/Riot/Modules/Home/Views/RoomCollectionViewCell.m +++ b/Riot/Modules/Home/Views/RoomCollectionViewCell.m @@ -66,13 +66,13 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; { [super customizeCollectionViewCellRendering]; - self.roomTitle.textColor = ThemeService.theme.textPrimaryColor; - self.roomTitle1.textColor = ThemeService.theme.textPrimaryColor; - self.roomTitle2.textColor = ThemeService.theme.textPrimaryColor; - self.missedNotifAndUnreadBadgeLabel.textColor = ThemeService.theme.backgroundColor; + self.roomTitle.textColor = ThemeService.shared.theme.textPrimaryColor; + self.roomTitle1.textColor = ThemeService.shared.theme.textPrimaryColor; + self.roomTitle2.textColor = ThemeService.shared.theme.textPrimaryColor; + self.missedNotifAndUnreadBadgeLabel.textColor = ThemeService.shared.theme.backgroundColor; // Prepare direct room border - CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(ThemeService.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); + CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(ThemeService.shared.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); [self.directRoomBorderView.layer setCornerRadius:self.directRoomBorderView.frame.size.width / 2]; self.directRoomBorderView.clipsToBounds = YES; @@ -81,7 +81,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; CFRelease(directRoomBorderColor); - self.editionArrowView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.editionArrowView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; self.roomAvatar.defaultBackgroundColor = [UIColor clearColor]; } @@ -126,7 +126,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; if (0 < roomCellData.notificationCount) { self.missedNotifAndUnreadBadgeBgView.hidden = NO; - self.missedNotifAndUnreadBadgeBgView.backgroundColor = roomCellData.highlightCount ? ThemeService.theme.notificationMentionColor : ThemeService.theme.notificationUnreadColor; + self.missedNotifAndUnreadBadgeBgView.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.notificationMentionColor : ThemeService.shared.theme.notificationUnreadColor; self.missedNotifAndUnreadBadgeLabel.text = roomCellData.notificationCountStringValue; [self.missedNotifAndUnreadBadgeLabel sizeToFit]; @@ -147,7 +147,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; else if (roomCellData.roomSummary.room.summary.membership == MXMembershipInvite) { self.missedNotifAndUnreadBadgeBgView.hidden = NO; - self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.theme.notificationMentionColor; + self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.notificationMentionColor; self.missedNotifAndUnreadBadgeLabel.text = @"!"; [self.missedNotifAndUnreadBadgeLabel sizeToFit]; diff --git a/Riot/Modules/Home/Views/TableViewCellWithCollectionView.m b/Riot/Modules/Home/Views/TableViewCellWithCollectionView.m index 3a9f41332..bb7afbb8c 100644 --- a/Riot/Modules/Home/Views/TableViewCellWithCollectionView.m +++ b/Riot/Modules/Home/Views/TableViewCellWithCollectionView.m @@ -32,7 +32,7 @@ { [super customizeTableViewCellRendering]; - self.editionView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.editionView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; } - (void)prepareForReuse diff --git a/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m b/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m index 1d1eb9827..f74637cde 100644 --- a/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m +++ b/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m @@ -113,15 +113,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.assetsCollectionView.backgroundColor = ThemeService.theme.backgroundColor; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.assetsCollectionView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (BOOL)prefersStatusBarHidden diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.m b/Riot/Modules/MediaPicker/MediaPickerViewController.m index db1814a29..ff48c46b0 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.m +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.m @@ -182,20 +182,20 @@ static void *RecordingContext = &RecordingContext; - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.cameraVideoCaptureProgressView.progressColor = ThemeService.theme.backgroundColor; + self.cameraVideoCaptureProgressView.progressColor = ThemeService.shared.theme.backgroundColor; self.cameraVideoCaptureProgressView.unprogressColor = [UIColor clearColor]; - self.userAlbumsTableView.backgroundColor = ThemeService.theme.backgroundColor; - self.view.backgroundColor = ThemeService.theme.backgroundColor; + self.userAlbumsTableView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (BOOL)prefersStatusBarHidden @@ -343,12 +343,12 @@ static void *RecordingContext = &RecordingContext; if (self.cameraVideoCaptureProgressView.progressColor != [UIColor lightGrayColor]) { self.cameraVideoCaptureProgressView.progressColor = [UIColor lightGrayColor]; - self.cameraVideoCaptureProgressView.unprogressColor = ThemeService.theme.backgroundColor; + self.cameraVideoCaptureProgressView.unprogressColor = ThemeService.shared.theme.backgroundColor; } } - else if (self.cameraVideoCaptureProgressView.progressColor != ThemeService.theme.backgroundColor) + else if (self.cameraVideoCaptureProgressView.progressColor != ThemeService.shared.theme.backgroundColor) { - self.cameraVideoCaptureProgressView.progressColor = ThemeService.theme.backgroundColor; + self.cameraVideoCaptureProgressView.progressColor = ThemeService.shared.theme.backgroundColor; self.cameraVideoCaptureProgressView.unprogressColor = [UIColor lightGrayColor]; } @@ -1765,13 +1765,13 @@ static void *RecordingContext = &RecordingContext; - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/MediaPicker/Views/MediaAlbumTableCell.m b/Riot/Modules/MediaPicker/Views/MediaAlbumTableCell.m index 227ad4c98..2f2f1e40a 100644 --- a/Riot/Modules/MediaPicker/Views/MediaAlbumTableCell.m +++ b/Riot/Modules/MediaPicker/Views/MediaAlbumTableCell.m @@ -26,8 +26,8 @@ { [super customizeTableViewCellRendering]; - self.albumDisplayNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.albumCountLabel.textColor = ThemeService.theme.textSecondaryColor; + self.albumDisplayNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.albumCountLabel.textColor = ThemeService.shared.theme.textSecondaryColor; } @end diff --git a/Riot/Modules/People/Views/InviteRecentTableViewCell.m b/Riot/Modules/People/Views/InviteRecentTableViewCell.m index 41e265d46..e094e6c85 100644 --- a/Riot/Modules/People/Views/InviteRecentTableViewCell.m +++ b/Riot/Modules/People/Views/InviteRecentTableViewCell.m @@ -60,10 +60,10 @@ NSString *const kInviteRecentTableViewCellRoomKey = @"kInviteRecentTableViewCell { [super customizeTableViewCellRendering]; - self.leftButton.backgroundColor = ThemeService.theme.tintColor; - self.rightButton.backgroundColor = ThemeService.theme.tintColor; + self.leftButton.backgroundColor = ThemeService.shared.theme.tintColor; + self.rightButton.backgroundColor = ThemeService.shared.theme.tintColor; - self.noticeBadgeView.backgroundColor = ThemeService.theme.notificationMentionColor; + self.noticeBadgeView.backgroundColor = ThemeService.shared.theme.notificationMentionColor; } - (void)onDeclinePressed:(id)sender diff --git a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m index dbc1cb419..7f490e176 100644 --- a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m +++ b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m @@ -339,7 +339,7 @@ double const kPublicRoomsDirectoryDataExpiration = 10; if (!tableViewCell) { tableViewCell = [[MXKTableViewCell alloc] init]; - tableViewCell.textLabel.textColor = ThemeService.theme.textSecondaryColor; + tableViewCell.textLabel.textColor = ThemeService.shared.theme.textSecondaryColor; tableViewCell.textLabel.font = [UIFont systemFontOfSize:15.0]; tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone; } diff --git a/Riot/Modules/PublicRoomList/Views/PublicRoomTableViewCell.m b/Riot/Modules/PublicRoomList/Views/PublicRoomTableViewCell.m index 71654cc32..4195b241b 100644 --- a/Riot/Modules/PublicRoomList/Views/PublicRoomTableViewCell.m +++ b/Riot/Modules/PublicRoomList/Views/PublicRoomTableViewCell.m @@ -38,9 +38,9 @@ { [super customizeTableViewCellRendering]; - self.roomDisplayName.textColor = ThemeService.theme.textPrimaryColor; - self.roomTopic.textColor = ThemeService.theme.textSecondaryColor; - self.memberCount.textColor = ThemeService.theme.textSecondaryColor; + self.roomDisplayName.textColor = ThemeService.shared.theme.textPrimaryColor; + self.roomTopic.textColor = ThemeService.shared.theme.textSecondaryColor; + self.memberCount.textColor = ThemeService.shared.theme.textSecondaryColor; _roomAvatar.defaultBackgroundColor = [UIColor clearColor]; } diff --git a/Riot/Modules/Room/Attachements/AttachmentsViewController.m b/Riot/Modules/Room/Attachements/AttachmentsViewController.m index d15d775d4..33637679b 100644 --- a/Riot/Modules/Room/Attachements/AttachmentsViewController.m +++ b/Riot/Modules/Room/Attachements/AttachmentsViewController.m @@ -59,12 +59,12 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.view.backgroundColor = ThemeService.theme.backgroundColor; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.backButton.tintColor = ThemeService.theme.tintColor; + self.backButton.tintColor = ThemeService.shared.theme.tintColor; } - (void)viewWillAppear:(BOOL)animated diff --git a/Riot/Modules/Room/DataSources/RoomDataSource.m b/Riot/Modules/Room/DataSources/RoomDataSource.m index 21af3d0ed..03457f1dd 100644 --- a/Riot/Modules/Room/DataSources/RoomDataSource.m +++ b/Riot/Modules/Room/DataSources/RoomDataSource.m @@ -386,7 +386,7 @@ if ([component.event.eventId isEqualToString:self.room.accountData.readMarkerEventId]) { bubbleCell.readMarkerView = [[UIView alloc] initWithFrame:CGRectMake(0, bottomPositionY - 2, bubbleCell.bubbleOverlayContainer.frame.size.width, 2)]; - bubbleCell.readMarkerView.backgroundColor = ThemeService.theme.tintColor; + bubbleCell.readMarkerView.backgroundColor = ThemeService.shared.theme.tintColor; // Hide by default the marker, it will be shown and animated when the cell will be rendered. bubbleCell.readMarkerView.hidden = YES; bubbleCell.readMarkerView.tag = index; diff --git a/Riot/Modules/Room/Files/RoomFilesViewController.m b/Riot/Modules/Room/Files/RoomFilesViewController.m index 1dc6d7e68..4fb62f934 100644 --- a/Riot/Modules/Room/Files/RoomFilesViewController.m +++ b/Riot/Modules/Room/Files/RoomFilesViewController.m @@ -110,12 +110,12 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.bubblesTableView.backgroundColor; if (self.bubblesTableView.dataSource) @@ -126,7 +126,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -193,13 +193,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m index a0b50f358..95be2db5d 100644 --- a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m +++ b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m @@ -218,17 +218,17 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; self.navigationController.navigationBar.translucent = YES; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.memberHeaderView.backgroundColor = ThemeService.theme.baseColor; - self.roomMemberNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.roomMemberStatusLabel.textColor = ThemeService.theme.tintColor; + self.memberHeaderView.backgroundColor = ThemeService.shared.theme.baseColor; + self.roomMemberNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.roomMemberStatusLabel.textColor = ThemeService.shared.theme.tintColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -239,7 +239,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (BOOL)prefersStatusBarHidden @@ -360,7 +360,7 @@ } return [MXKTools paintImage:[UIImage imageNamed:@"placeholder"] - withColor:ThemeService.theme.tintColor]; + withColor:ThemeService.shared.theme.tintColor]; } - (void)updateMemberInfo @@ -781,8 +781,8 @@ } else { - [cellWithButton.mxkButton setTitleColor:ThemeService.theme.textPrimaryColor forState:UIControlStateNormal]; - [cellWithButton.mxkButton setTitleColor:ThemeService.theme.textPrimaryColor forState:UIControlStateHighlighted]; + [cellWithButton.mxkButton setTitleColor:ThemeService.shared.theme.textPrimaryColor forState:UIControlStateNormal]; + [cellWithButton.mxkButton setTitleColor:ThemeService.shared.theme.textPrimaryColor forState:UIControlStateHighlighted]; } [cellWithButton.mxkButton addTarget:self action:@selector(onActionButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; @@ -843,13 +843,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Room/Members/RoomParticipantsViewController.m b/Riot/Modules/Room/Members/RoomParticipantsViewController.m index ef14422b9..1ce43f6f2 100644 --- a/Riot/Modules/Room/Members/RoomParticipantsViewController.m +++ b/Riot/Modules/Room/Members/RoomParticipantsViewController.m @@ -157,21 +157,21 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; [self refreshSearchBarItemsColor:_searchBarView]; - _searchBarHeaderBorder.backgroundColor = ThemeService.theme.headerBorderColor; + _searchBarHeaderBorder.backgroundColor = ThemeService.shared.theme.headerBorderColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; // Update the gradient view above the screen CGFloat white = 1.0; - [ThemeService.theme.backgroundColor getWhite:&white alpha:nil]; + [ThemeService.shared.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; tableViewMaskLayer.colors = @[(__bridge id) transparentWhiteColor, (__bridge id) transparentWhiteColor, (__bridge id) opaqueWhiteColor]; @@ -184,7 +184,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } // This method is called when the viewcontroller is added or removed from a container view controller. @@ -575,9 +575,9 @@ // Add blur mask programmatically tableViewMaskLayer = [CAGradientLayer layer]; - // Consider the grayscale components of the ThemeService.theme.backgroundColor. + // Consider the grayscale components of the ThemeService.shared.theme.backgroundColor. CGFloat white = 1.0; - [ThemeService.theme.backgroundColor getWhite:&white alpha:nil]; + [ThemeService.shared.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; @@ -1175,13 +1175,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -1215,7 +1215,7 @@ if (section == invitedSection) { sectionHeader = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 30)]; - sectionHeader.backgroundColor = ThemeService.theme.headerBackgroundColor; + sectionHeader.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; CGRect frame = sectionHeader.frame; frame.origin.x = 20; @@ -1223,7 +1223,7 @@ frame.size.width = sectionHeader.frame.size.width - 10; frame.size.height -= 10; UILabel *headerLabel = [[UILabel alloc] initWithFrame:frame]; - headerLabel.textColor = ThemeService.theme.textPrimaryColor; + headerLabel.textColor = ThemeService.shared.theme.textPrimaryColor; headerLabel.font = [UIFont boldSystemFontOfSize:15.0]; headerLabel.backgroundColor = [UIColor clearColor]; @@ -1327,7 +1327,7 @@ }]; - leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; + leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:leaveAction atIndex:0]; } @@ -1684,19 +1684,19 @@ - (void)refreshSearchBarItemsColor:(UISearchBar *)searchBar { // bar tint color - searchBar.barTintColor = searchBar.tintColor = ThemeService.theme.tintColor; - searchBar.tintColor = ThemeService.theme.tintColor; + searchBar.barTintColor = searchBar.tintColor = ThemeService.shared.theme.tintColor; + searchBar.tintColor = ThemeService.shared.theme.tintColor; // FIXME: this all seems incredibly fragile and tied to gutwrenching the current UISearchBar internals. // text color UITextField *searchBarTextField = [searchBar valueForKey:@"_searchField"]; - searchBarTextField.textColor = ThemeService.theme.textSecondaryColor; + searchBarTextField.textColor = ThemeService.shared.theme.textSecondaryColor; // Magnifying glass icon. UIImageView *leftImageView = (UIImageView *)searchBarTextField.leftView; leftImageView.image = [leftImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - leftImageView.tintColor = ThemeService.theme.tintColor; + leftImageView.tintColor = ThemeService.shared.theme.tintColor; // remove the gray background color UIView *effectBackgroundTop = [searchBarTextField valueForKey:@"_effectBackgroundTop"]; @@ -1707,8 +1707,8 @@ // place holder searchBarTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:searchBarTextField.placeholder attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), - NSUnderlineColorAttributeName: ThemeService.theme.tintColor, - NSForegroundColorAttributeName: ThemeService.theme.tintColor}]; + NSUnderlineColorAttributeName: ThemeService.shared.theme.tintColor, + NSForegroundColorAttributeName: ThemeService.shared.theme.tintColor}]; } - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText diff --git a/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m b/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m index b861b80a2..432d5f6c9 100644 --- a/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m +++ b/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m @@ -94,20 +94,20 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - self.overlayView.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.overlayView.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; self.overlayView.alpha = 1.0; - self.titleLabel.textColor = ThemeService.theme.textPrimaryColor; - self.containerView.backgroundColor = ThemeService.theme.backgroundColor; + self.titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.containerView.backgroundColor = ThemeService.shared.theme.backgroundColor; // Check the table view style to select its bg color. - self.receiptsTableView.backgroundColor = ((self.receiptsTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.receiptsTableView.backgroundColor = ((self.receiptsTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); - self.closeButton.tintColor = ThemeService.theme.tintColor; + self.closeButton.tintColor = ThemeService.shared.theme.tintColor; if (self.receiptsTableView.dataSource) { @@ -118,7 +118,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -196,8 +196,8 @@ { MXKReadReceiptTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[MXKReadReceiptTableViewCell defaultReuseIdentifier] forIndexPath:indexPath]; - cell.displayNameLabel.textColor = ThemeService.theme.textPrimaryColor; - cell.receiptDescriptionLabel.textColor = ThemeService.theme.textSecondaryColor; + cell.displayNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + cell.receiptDescriptionLabel.textColor = ThemeService.shared.theme.textSecondaryColor; if (indexPath.row < self.roomMembers.count) { @@ -224,9 +224,9 @@ NSString *receiptReadText = NSLocalizedStringFromTable(@"receipt_status_read", @"Vector", nil); NSString *receiptTimeText = [(MXKEventFormatter*)self.session.roomSummaryUpdateDelegate dateStringFromTimestamp:self.receipts[indexPath.row].ts withTime:YES]; - NSMutableAttributedString *receiptDescription = [[NSMutableAttributedString alloc] initWithString:receiptReadText attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textSecondaryColor, NSFontAttributeName : [UIFont boldSystemFontOfSize:15]}]; + NSMutableAttributedString *receiptDescription = [[NSMutableAttributedString alloc] initWithString:receiptReadText attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textSecondaryColor, NSFontAttributeName : [UIFont boldSystemFontOfSize:15]}]; - [receiptDescription appendAttributedString:[[NSAttributedString alloc] initWithString:receiptTimeText attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textSecondaryColor, NSFontAttributeName : [UIFont systemFontOfSize:15]}]]; + [receiptDescription appendAttributedString:[[NSAttributedString alloc] initWithString:receiptTimeText attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textSecondaryColor, NSFontAttributeName : [UIFont systemFontOfSize:15]}]]; cell.receiptDescriptionLabel.attributedText = receiptDescription; } @@ -240,13 +240,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index c15949e1a..c68afb7de 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -418,25 +418,25 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; self.navigationController.navigationBar.translucent = YES; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Prepare jump to last unread banner - self.jumpToLastUnreadBannerContainer.backgroundColor = ThemeService.theme.backgroundColor; - self.jumpToLastUnreadLabel.attributedText = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"room_jump_to_first_unread", @"Vector", nil) attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), NSUnderlineColorAttributeName: ThemeService.theme.textPrimaryColor, NSForegroundColorAttributeName: ThemeService.theme.textPrimaryColor}]; + self.jumpToLastUnreadBannerContainer.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.jumpToLastUnreadLabel.attributedText = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"room_jump_to_first_unread", @"Vector", nil) attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), NSUnderlineColorAttributeName: ThemeService.shared.theme.textPrimaryColor, NSForegroundColorAttributeName: ThemeService.shared.theme.textPrimaryColor}]; - self.expandedHeaderContainer.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.previewHeaderContainer.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.expandedHeaderContainer.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.previewHeaderContainer.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; - missedDiscussionsBadgeLabel.textColor = ThemeService.theme.backgroundColor; + missedDiscussionsBadgeLabel.textColor = ThemeService.shared.theme.backgroundColor; missedDiscussionsBadgeLabel.font = [UIFont boldSystemFontOfSize:14]; missedDiscussionsBadgeLabel.backgroundColor = [UIColor clearColor]; // Check the table view style to select its bg color. - self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.bubblesTableView.backgroundColor; if (self.bubblesTableView.dataSource) @@ -447,7 +447,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)didReceiveMemoryWarning @@ -1752,7 +1752,7 @@ else { previewHeader.roomAvatarPlaceholder = [MXKTools paintImage:[UIImage imageNamed:@"placeholder"] - withColor:ThemeService.theme.tintColor]; + withColor:ThemeService.shared.theme.tintColor]; } } @@ -3338,13 +3338,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -4230,11 +4230,11 @@ // Set the right background color if (highlightCount) { - missedDiscussionsBadgeLabelBgView.backgroundColor = ThemeService.theme.notificationMentionColor; + missedDiscussionsBadgeLabelBgView.backgroundColor = ThemeService.shared.theme.notificationMentionColor; } else { - missedDiscussionsBadgeLabelBgView.backgroundColor = ThemeService.theme.notificationUnreadColor; + missedDiscussionsBadgeLabelBgView.backgroundColor = ThemeService.shared.theme.notificationUnreadColor; } if (!missedDiscussionsButton || [leftBarButtonItems indexOfObject:missedDiscussionsButton] == NSNotFound) diff --git a/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m b/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m index 4aca0ba4d..3ff3145d6 100644 --- a/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m +++ b/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m @@ -69,7 +69,7 @@ if (cellData) { // Highlight the search pattern - [cellData highlightPatternInTextMessage:self.searchText withForegroundColor:ThemeService.theme.tintColor andFont:patternFont]; + [cellData highlightPatternInTextMessage:self.searchText withForegroundColor:ThemeService.shared.theme.tintColor andFont:patternFont]; // Use profile information as data to display MXSearchUserProfile *userProfile = result.context.profileInfo[result.result.sender]; diff --git a/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m b/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m index 03e5b73fe..51c74d6a1 100644 --- a/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m +++ b/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m @@ -72,15 +72,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = ThemeService.theme.backgroundColor; + self.noResultsLabel.textColor = ThemeService.shared.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -90,7 +90,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -146,13 +146,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m b/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m index a6698ab9c..a13185f45 100644 --- a/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m +++ b/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m @@ -73,15 +73,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = ThemeService.theme.backgroundColor; + self.noResultsLabel.textColor = ThemeService.shared.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -91,7 +91,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -173,13 +173,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Room/Search/RoomSearchViewController.m b/Riot/Modules/Room/Search/RoomSearchViewController.m index 414848622..674c4abc7 100644 --- a/Riot/Modules/Room/Search/RoomSearchViewController.m +++ b/Riot/Modules/Room/Search/RoomSearchViewController.m @@ -80,7 +80,7 @@ UIImageView *backgroundImageView = self.backgroundImageView; if (backgroundImageView) { - UIImage *image = [MXKTools paintImage:backgroundImageView.image withColor:ThemeService.theme.matrixSearchBackgroundImageTintColor]; + UIImage *image = [MXKTools paintImage:backgroundImageView.image withColor:ThemeService.shared.theme.matrixSearchBackgroundImageTintColor]; backgroundImageView.image = image; } } diff --git a/Riot/Modules/Room/Settings/RoomSettingsViewController.m b/Riot/Modules/Room/Settings/RoomSettingsViewController.m index 54810537c..609422b8c 100644 --- a/Riot/Modules/Room/Settings/RoomSettingsViewController.m +++ b/Riot/Modules/Room/Settings/RoomSettingsViewController.m @@ -266,12 +266,12 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -282,7 +282,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)viewWillAppear:(BOOL)animated @@ -2053,7 +2053,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti { // Customize label style UITableViewHeaderFooterView *tableViewHeaderFooterView = (UITableViewHeaderFooterView*)view; - tableViewHeaderFooterView.textLabel.textColor = ThemeService.theme.textPrimaryColor; + tableViewHeaderFooterView.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; tableViewHeaderFooterView.textLabel.font = [UIFont systemFontOfSize:15]; } } @@ -2178,7 +2178,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti roomPhotoCell.mxkImageView.defaultBackgroundColor = [UIColor clearColor]; roomPhotoCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_photo", @"Vector", nil); - roomPhotoCell.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + roomPhotoCell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; if (updatedItemsDict[kRoomSettingsAvatarKey]) { @@ -2213,16 +2213,16 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti topicTextView.text = mxRoomState.topic; } - topicTextView.tintColor = ThemeService.theme.tintColor; + topicTextView.tintColor = ThemeService.shared.theme.tintColor; topicTextView.font = [UIFont systemFontOfSize:15]; topicTextView.bounces = NO; topicTextView.delegate = self; // disable the edition if the user cannot update it topicTextView.editable = (oneSelfPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomTopic]); - topicTextView.textColor = ThemeService.theme.textSecondaryColor; + topicTextView.textColor = ThemeService.shared.theme.textSecondaryColor; - topicTextView.keyboardAppearance = ThemeService.theme.keyboardAppearance; + topicTextView.keyboardAppearance = ThemeService.shared.theme.keyboardAppearance; cell = roomTopicCell; } @@ -2235,14 +2235,14 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti roomNameCell.mxkTextFieldTrailingConstraint.constant = 15; roomNameCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_room_name", @"Vector", nil); - roomNameCell.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + roomNameCell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; roomNameCell.accessoryType = UITableViewCellAccessoryNone; roomNameCell.accessoryView = nil; nameTextField = roomNameCell.mxkTextField; - nameTextField.tintColor = ThemeService.theme.tintColor; + nameTextField.tintColor = ThemeService.shared.theme.tintColor; nameTextField.font = [UIFont systemFontOfSize:17]; nameTextField.borderStyle = UITextBorderStyleNone; nameTextField.textAlignment = NSTextAlignmentRight; @@ -2259,7 +2259,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti // disable the edition if the user cannot update it nameTextField.userInteractionEnabled = (oneSelfPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomName]); - nameTextField.textColor = ThemeService.theme.textSecondaryColor; + nameTextField.textColor = ThemeService.shared.theme.textSecondaryColor; // Add a "textFieldDidChange" notification method to the text field control. [nameTextField addTarget:self action:@selector(onTextFieldUpdate:) forControlEvents:UIControlEventEditingChanged]; @@ -2280,10 +2280,10 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti NSArray *labels = roomTagCell.labels; UILabel *label; label = labels[0]; - label.textColor = ThemeService.theme.textPrimaryColor; + label.textColor = ThemeService.shared.theme.textPrimaryColor; label.text = NSLocalizedStringFromTable(@"room_details_favourite_tag", @"Vector", nil); label = labels[1]; - label.textColor = ThemeService.theme.textPrimaryColor; + label.textColor = ThemeService.shared.theme.textPrimaryColor; label.text = NSLocalizedStringFromTable(@"room_details_low_priority_tag", @"Vector", nil); if (updatedItemsDict[kRoomSettingsTagKey]) @@ -2320,7 +2320,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti [leaveCell.mxkButton setTitle:title forState:UIControlStateNormal]; [leaveCell.mxkButton setTitle:title forState:UIControlStateHighlighted]; - [leaveCell.mxkButton setTintColor:ThemeService.theme.tintColor]; + [leaveCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor]; leaveCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17]; [leaveCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -2499,17 +2499,17 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti addAddressTextField = addAddressCell.mxkTextField; addAddressTextField.placeholder = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_details_new_address_placeholder", @"Vector", nil), self.mainSession.matrixRestClient.homeserverSuffix]; - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { addAddressTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:addAddressTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } addAddressTextField.userInteractionEnabled = YES; addAddressTextField.text = currentValue; - addAddressTextField.textColor = ThemeService.theme.textSecondaryColor; + addAddressTextField.textColor = ThemeService.shared.theme.textSecondaryColor; - addAddressTextField.tintColor = ThemeService.theme.tintColor; + addAddressTextField.tintColor = ThemeService.shared.theme.tintColor; addAddressTextField.font = [UIFont systemFontOfSize:17]; addAddressTextField.borderStyle = UITextBorderStyleNone; addAddressTextField.textAlignment = NSTextAlignmentLeft; @@ -2525,7 +2525,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti UITableViewCell *addressCell = [tableView dequeueReusableCellWithIdentifier:kRoomSettingsAddressCellViewIdentifier forIndexPath:indexPath]; addressCell.textLabel.font = [UIFont systemFontOfSize:16]; - addressCell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + addressCell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; addressCell.textLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; addressCell.accessoryView = nil; addressCell.accessoryType = UITableViewCellAccessoryNone; @@ -2590,17 +2590,17 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti addGroupTextField = addCommunityCell.mxkTextField; addGroupTextField.placeholder = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_details_new_flair_placeholder", @"Vector", nil), self.mainSession.matrixRestClient.homeserverSuffix]; - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { addGroupTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:addGroupTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } addGroupTextField.userInteractionEnabled = YES; addGroupTextField.text = currentValue; - addGroupTextField.textColor = ThemeService.theme.textSecondaryColor; + addGroupTextField.textColor = ThemeService.shared.theme.textSecondaryColor; - addGroupTextField.tintColor = ThemeService.theme.tintColor; + addGroupTextField.tintColor = ThemeService.shared.theme.tintColor; addGroupTextField.font = [UIFont systemFontOfSize:17]; addGroupTextField.borderStyle = UITextBorderStyleNone; addGroupTextField.textAlignment = NSTextAlignmentLeft; @@ -2616,7 +2616,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti UITableViewCell *communityCell = [tableView dequeueReusableCellWithIdentifier:kRoomSettingsAddressCellViewIdentifier forIndexPath:indexPath]; communityCell.textLabel.font = [UIFont systemFontOfSize:16]; - communityCell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + communityCell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; communityCell.textLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; communityCell.accessoryView = nil; communityCell.accessoryType = UITableViewCellAccessoryNone; @@ -2634,7 +2634,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti UITableViewCell *addressCell = [tableView dequeueReusableCellWithIdentifier:kRoomSettingsAddressCellViewIdentifier forIndexPath:indexPath]; addressCell.textLabel.font = [UIFont systemFontOfSize:16]; - addressCell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + addressCell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; addressCell.textLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; addressCell.accessoryView = nil; addressCell.accessoryType = UITableViewCellAccessoryNone; @@ -2656,11 +2656,11 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti cell.textLabel.font = [UIFont systemFontOfSize:17]; cell.textLabel.text = NSLocalizedStringFromTable(@"room_details_advanced_room_id", @"Vector", nil); - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.detailTextLabel.font = [UIFont systemFontOfSize:15]; cell.detailTextLabel.text = mxRoomState.roomId; - cell.detailTextLabel.textColor = ThemeService.theme.textSecondaryColor; + cell.detailTextLabel.textColor = ThemeService.shared.theme.textSecondaryColor; cell.detailTextLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; cell.selectionStyle = UITableViewCellSelectionStyleNone; @@ -2672,7 +2672,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti MXKTableViewCellWithLabelAndSwitch *roomBlacklistUnverifiedDevicesCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; [roomBlacklistUnverifiedDevicesCell.mxkSwitch addTarget:self action:@selector(toggleBlacklistUnverifiedDevice:) forControlEvents:UIControlEventValueChanged]; - roomBlacklistUnverifiedDevicesCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + roomBlacklistUnverifiedDevicesCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; roomBlacklistUnverifiedDevicesCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_advanced_e2e_encryption_blacklist_unverified_devices", @"Vector", nil); @@ -2719,7 +2719,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti cell.textLabel.font = [UIFont systemFontOfSize:17]; cell.textLabel.numberOfLines = 0; cell.textLabel.text = NSLocalizedStringFromTable(@"room_details_advanced_e2e_encryption_enabled", @"Vector", nil); - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.selectionStyle = UITableViewCellSelectionStyleNone; } @@ -2753,7 +2753,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti cell.textLabel.font = [UIFont systemFontOfSize:17]; cell.textLabel.numberOfLines = 0; cell.textLabel.text = NSLocalizedStringFromTable(@"room_details_advanced_e2e_encryption_disabled", @"Vector", nil); - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.selectionStyle = UITableViewCellSelectionStyleNone; } @@ -2801,9 +2801,9 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti cell.mxkLabelLeadingConstraint.constant = cell.separatorInset.left; cell.mxkSwitchTrailingConstraint.constant = 15; - cell.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - cell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + cell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; [cell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventValueChanged]; // Reset the stored `directoryVisibilitySwitch` if the corresponding cell is reused. @@ -2822,13 +2822,13 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -3117,7 +3117,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; - removeAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(44, 44) resourceSize:CGSizeMake(24, 24)]; + removeAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(44, 44) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:removeAction atIndex:0]; } } @@ -3132,7 +3132,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; - removeAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(44, 44) resourceSize:CGSizeMake(24, 24)]; + removeAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(44, 44) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:removeAction atIndex:0]; } diff --git a/Riot/Modules/Room/Settings/Views/TableViewCellWithCheckBoxAndLabel.m b/Riot/Modules/Room/Settings/Views/TableViewCellWithCheckBoxAndLabel.m index d15818a8a..5f575c745 100644 --- a/Riot/Modules/Room/Settings/Views/TableViewCellWithCheckBoxAndLabel.m +++ b/Riot/Modules/Room/Settings/Views/TableViewCellWithCheckBoxAndLabel.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - _label.textColor = ThemeService.theme.textPrimaryColor; + _label.textColor = ThemeService.shared.theme.textPrimaryColor; } - (void)setEnabled:(BOOL)enabled diff --git a/Riot/Modules/Room/Settings/Views/TableViewCellWithLabelAndLargeTextView.m b/Riot/Modules/Room/Settings/Views/TableViewCellWithLabelAndLargeTextView.m index 36b34e556..deecdd99e 100644 --- a/Riot/Modules/Room/Settings/Views/TableViewCellWithLabelAndLargeTextView.m +++ b/Riot/Modules/Room/Settings/Views/TableViewCellWithLabelAndLargeTextView.m @@ -37,8 +37,8 @@ { [super customizeTableViewCellRendering]; - _label.textColor = ThemeService.theme.textPrimaryColor; - _textView.textColor = ThemeService.theme.textPrimaryColor; + _label.textColor = ThemeService.shared.theme.textPrimaryColor; + _textView.textColor = ThemeService.shared.theme.textPrimaryColor; } - (void)layoutSubviews diff --git a/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m b/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m index 7a88f7607..c5ebadf5a 100644 --- a/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m +++ b/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m @@ -112,10 +112,10 @@ { [super customizeViewRendering]; - self.separatorView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.separatorView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; if (self.messageLabel.textColor != kRiotColorPinkRed) { - self.messageLabel.textColor = ThemeService.theme.textSecondaryColor; + self.messageLabel.textColor = ThemeService.shared.theme.textSecondaryColor; } } @@ -260,12 +260,12 @@ // Display the string in white on pink red NSRange wholeString = NSMakeRange(0, onGoingConferenceCallAttibutedString.length); - [onGoingConferenceCallAttibutedString addAttribute:NSForegroundColorAttributeName value:ThemeService.theme.backgroundColor range:wholeString]; + [onGoingConferenceCallAttibutedString addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.backgroundColor range:wholeString]; [onGoingConferenceCallAttibutedString addAttribute:NSBackgroundColorAttributeName value:kRiotColorPinkRed range:wholeString]; [onGoingConferenceCallAttibutedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15] range:wholeString]; self.messageTextView.attributedText = onGoingConferenceCallAttibutedString; - self.messageTextView.tintColor = ThemeService.theme.backgroundColor; + self.messageTextView.tintColor = ThemeService.shared.theme.backgroundColor; self.messageTextView.hidden = NO; self.backgroundColor = kRiotColorPinkRed; @@ -356,7 +356,7 @@ [roomReplacementAttributedString appendAttributedString:roomLinkAttributedString]; NSRange wholeStringRange = NSMakeRange(0, roomReplacementAttributedString.length); - [roomReplacementAttributedString addAttribute:NSForegroundColorAttributeName value:ThemeService.theme.textPrimaryColor range:wholeStringRange]; + [roomReplacementAttributedString addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.textPrimaryColor range:wholeStringRange]; self.messageTextView.attributedText = roomReplacementAttributedString; } @@ -365,7 +365,7 @@ self.messageTextView.text = NSLocalizedStringFromTable(@"room_replacement_information", @"Vector", nil); } - self.messageTextView.tintColor = ThemeService.theme.textPrimaryColor; + self.messageTextView.tintColor = ThemeService.shared.theme.textPrimaryColor; self.messageTextView.hidden = NO; self.messageTextView.backgroundColor = [UIColor clearColor]; @@ -432,13 +432,13 @@ message2 = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"room_resource_usage_limit_reached_message_2", @"Vector", nil) attributes:@{ NSFontAttributeName: [UIFont boldSystemFontOfSize:fontSize], - NSForegroundColorAttributeName: ThemeService.theme.backgroundColor + NSForegroundColorAttributeName: ThemeService.shared.theme.backgroundColor }]; } NSDictionary *attributes = @{ NSFontAttributeName: [UIFont systemFontOfSize:fontSize], - NSForegroundColorAttributeName: ThemeService.theme.backgroundColor + NSForegroundColorAttributeName: ThemeService.shared.theme.backgroundColor }; NSDictionary *messageContact2LinkAttributes; @@ -482,7 +482,7 @@ [attributedText appendAttributedString:messageContact3]; self.messageTextView.attributedText = attributedText; - self.messageTextView.tintColor = ThemeService.theme.backgroundColor; + self.messageTextView.tintColor = ThemeService.shared.theme.backgroundColor; self.messageTextView.hidden = NO; if (hardLimit) @@ -535,7 +535,7 @@ [self.messageTextView resignFirstResponder]; self.messageTextView.hidden = YES; - self.messageLabel.textColor = ThemeService.theme.textSecondaryColor; + self.messageLabel.textColor = ThemeService.shared.theme.textSecondaryColor; objc_removeAssociatedObjects(self.messageTextView); } diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentBubbleCell.m index b5ebb38d2..ba01ef0b5 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentBubbleCell.m @@ -26,8 +26,8 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithPaginationTitleBubbleCell.m index e831f0bb0..8686be688 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithPaginationTitleBubbleCell.m @@ -26,11 +26,11 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithoutSenderInfoBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithoutSenderInfoBubbleCell.m index 86339cb3a..712385152 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithoutSenderInfoBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingAttachmentWithoutSenderInfoBubbleCell.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgBubbleCell.m index c14a48e76..605d9e9a3 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgBubbleCell.m @@ -26,8 +26,8 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleBubbleCell.m index f9cad605a..83bff1cf7 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleBubbleCell.m @@ -26,11 +26,11 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.m index 14252dccd..5078a9405 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderInfoBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderInfoBubbleCell.m index 5ba8eeb40..56b0db94c 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderInfoBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderInfoBubbleCell.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderNameBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderNameBubbleCell.m index b9aa838d8..15ab0389e 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderNameBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomIncomingTextMsgWithoutSenderNameBubbleCell.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipBubbleCell.m index e8b42d519..a15817d01 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipBubbleCell.m @@ -41,7 +41,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)prepareForReuse diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedBubbleCell.m index ffa7060b0..c19773bf9 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedBubbleCell.m @@ -30,7 +30,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)layoutSubviews diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedWithPaginationTitleBubbleCell.m index 27a2289bd..b93c8be3a 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipCollapsedWithPaginationTitleBubbleCell.m @@ -27,8 +27,8 @@ { [super customizeTableViewCellRendering]; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedBubbleCell.m index 73461a2b0..8cf27a17f 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedBubbleCell.m @@ -38,9 +38,9 @@ NSString *const kRoomMembershipExpandedBubbleCellTapOnCollapseButton = @"kRoomMe { [super customizeTableViewCellRendering]; - self.separatorView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.separatorView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; - [self.collapseButton setTintColor:ThemeService.theme.tintColor]; + [self.collapseButton setTintColor:ThemeService.shared.theme.tintColor]; self.collapseButton.titleLabel.font = [UIFont systemFontOfSize:14]; } diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedWithPaginationTitleBubbleCell.m index 12da4a91a..63262f645 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipExpandedWithPaginationTitleBubbleCell.m @@ -27,8 +27,8 @@ { [super customizeTableViewCellRendering]; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipWithPaginationTitleBubbleCell.m index 524e0e519..4ebebc70d 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomMembershipWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomMembershipWithPaginationTitleBubbleCell.m @@ -27,8 +27,8 @@ { [super customizeTableViewCellRendering]; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentBubbleCell.m index 44ad81b97..f24ac2f82 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentBubbleCell.m @@ -26,8 +26,8 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithPaginationTitleBubbleCell.m index cb3bc41a9..25911ddf2 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithPaginationTitleBubbleCell.m @@ -26,11 +26,11 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithoutSenderInfoBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithoutSenderInfoBubbleCell.m index c953a24ac..b60dac677 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithoutSenderInfoBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingAttachmentWithoutSenderInfoBubbleCell.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgBubbleCell.m index fff5b9005..bff6e2f13 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgBubbleCell.m @@ -26,8 +26,8 @@ { [super customizeTableViewCellRendering]; - self.userNameLabel.textColor = ThemeService.theme.textPrimaryColor; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.userNameLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithPaginationTitleBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithPaginationTitleBubbleCell.m index 71491b57b..85d4afb55 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithPaginationTitleBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithPaginationTitleBubbleCell.m @@ -26,8 +26,8 @@ { [super customizeTableViewCellRendering]; - self.paginationLabel.textColor = ThemeService.theme.tintColor; - self.paginationSeparatorView.backgroundColor = ThemeService.theme.tintColor; + self.paginationLabel.textColor = ThemeService.shared.theme.tintColor; + self.paginationSeparatorView.backgroundColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXKCellData *)cellData diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithoutSenderInfoBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithoutSenderInfoBubbleCell.m index 9af0586e3..1e0ffeb61 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithoutSenderInfoBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomOutgoingTextMsgWithoutSenderInfoBubbleCell.m @@ -26,7 +26,7 @@ { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.tintColor; + self.messageTextView.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomPredecessorBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomPredecessorBubbleCell.m index 5a866b7b3..dbcb44b50 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomPredecessorBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomPredecessorBubbleCell.m @@ -58,8 +58,8 @@ static CGFloat const kCustomBackgroundCornerRadius = 5.0; { [super customizeTableViewCellRendering]; - self.messageTextView.tintColor = ThemeService.theme.textPrimaryColor; - self.customBackgroundView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.messageTextView.tintColor = ThemeService.shared.theme.textPrimaryColor; + self.customBackgroundView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; } @end diff --git a/Riot/Modules/Room/Views/BubbleCells/RoomSelectedStickerBubbleCell.m b/Riot/Modules/Room/Views/BubbleCells/RoomSelectedStickerBubbleCell.m index e84ac884d..f63b5180c 100644 --- a/Riot/Modules/Room/Views/BubbleCells/RoomSelectedStickerBubbleCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/RoomSelectedStickerBubbleCell.m @@ -45,8 +45,8 @@ arrowMaskLayer.path = path.CGPath; self.arrowView.layer.mask = arrowMaskLayer; - self.arrowView.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.descriptionView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.arrowView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.descriptionView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; [self.descriptionView.layer setCornerRadius:10]; } diff --git a/Riot/Modules/Room/Views/Event/EventDetailsView.m b/Riot/Modules/Room/Views/Event/EventDetailsView.m index c96230f45..3f30e3987 100644 --- a/Riot/Modules/Room/Views/Event/EventDetailsView.m +++ b/Riot/Modules/Room/Views/Event/EventDetailsView.m @@ -25,11 +25,11 @@ { [super customizeViewRendering]; - self.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.textView.backgroundColor = ThemeService.theme.backgroundColor; - self.textView.textColor = ThemeService.theme.textPrimaryColor; - self.redactButton.tintColor = ThemeService.theme.tintColor; - self.closeButton.tintColor = ThemeService.theme.tintColor; + self.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.textView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.textView.textColor = ThemeService.shared.theme.textPrimaryColor; + self.redactButton.tintColor = ThemeService.shared.theme.tintColor; + self.closeButton.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Room/Views/InputToolbar/DisabledRoomInputToolbarView.m b/Riot/Modules/Room/Views/InputToolbar/DisabledRoomInputToolbarView.m index 777ac8255..d3dce27e5 100644 --- a/Riot/Modules/Room/Views/InputToolbar/DisabledRoomInputToolbarView.m +++ b/Riot/Modules/Room/Views/InputToolbar/DisabledRoomInputToolbarView.m @@ -48,11 +48,11 @@ // Remove default toolbar background color self.backgroundColor = [UIColor clearColor]; - self.separatorView.backgroundColor = ThemeService.theme.headerTextSecondaryColor; + self.separatorView.backgroundColor = ThemeService.shared.theme.headerTextSecondaryColor; self.disabledReasonTextView.font = [UIFont systemFontOfSize:15]; - self.disabledReasonTextView.textColor = ThemeService.theme.textPrimaryColor; - self.disabledReasonTextView.tintColor = ThemeService.theme.tintColor; + self.disabledReasonTextView.textColor = ThemeService.shared.theme.textPrimaryColor; + self.disabledReasonTextView.tintColor = ThemeService.shared.theme.tintColor; self.disabledReasonTextView.editable = NO; self.disabledReasonTextView.scrollEnabled = NO; } diff --git a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m index e88329627..577592a41 100644 --- a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m +++ b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m @@ -72,8 +72,8 @@ self.rightInputToolbarButton.hidden = YES; - [self.rightInputToolbarButton setTitleColor:ThemeService.theme.tintColor forState:UIControlStateNormal]; - [self.rightInputToolbarButton setTitleColor:ThemeService.theme.tintColor forState:UIControlStateHighlighted]; + [self.rightInputToolbarButton setTitleColor:ThemeService.shared.theme.tintColor forState:UIControlStateNormal]; + [self.rightInputToolbarButton setTitleColor:ThemeService.shared.theme.tintColor forState:UIControlStateHighlighted]; self.isEncryptionEnabled = _isEncryptionEnabled; } @@ -87,7 +87,7 @@ // Remove default toolbar background color self.backgroundColor = [UIColor clearColor]; - self.separatorView.backgroundColor = ThemeService.theme.headerTextSecondaryColor; + self.separatorView.backgroundColor = ThemeService.shared.theme.headerTextSecondaryColor; // Custom the growingTextView display growingTextView.layer.cornerRadius = 0; @@ -95,10 +95,10 @@ growingTextView.backgroundColor = [UIColor clearColor]; growingTextView.font = [UIFont systemFontOfSize:15]; - growingTextView.textColor = ThemeService.theme.textPrimaryColor; - growingTextView.tintColor = ThemeService.theme.tintColor; + growingTextView.textColor = ThemeService.shared.theme.textPrimaryColor; + growingTextView.tintColor = ThemeService.shared.theme.tintColor; - growingTextView.internalTextView.keyboardAppearance = ThemeService.theme.keyboardAppearance; + growingTextView.internalTextView.keyboardAppearance = ThemeService.shared.theme.keyboardAppearance; } #pragma mark - diff --git a/Riot/Modules/Room/Views/Title/Expanded/ExpandedRoomTitleView.m b/Riot/Modules/Room/Views/Title/Expanded/ExpandedRoomTitleView.m index 4709c4bf8..cd2972cbb 100644 --- a/Riot/Modules/Room/Views/Title/Expanded/ExpandedRoomTitleView.m +++ b/Riot/Modules/Room/Views/Title/Expanded/ExpandedRoomTitleView.m @@ -40,19 +40,19 @@ [super layoutSubviews]; self.membersListIcon.image = [MXKTools paintImage:self.membersListIcon.image - withColor:ThemeService.theme.tintColor]; + withColor:ThemeService.shared.theme.tintColor]; // TODO: paintImage does not work here because addParticipantIcon has 2 colors // self.addParticipantIcon.image = [MXKTools paintImage:self.addParticipantIcon.image -// withColor:ThemeService.theme.accent]; +// withColor:ThemeService.shared.theme.accent]; } -(void)customizeViewRendering { [super customizeViewRendering]; - self.roomTopic.textColor = ThemeService.theme.baseTextSecondaryColor; - self.roomMembers.textColor = ThemeService.theme.tintColor; + self.roomTopic.textColor = ThemeService.shared.theme.baseTextSecondaryColor; + self.roomMembers.textColor = ThemeService.shared.theme.tintColor; } - (void)refreshDisplay @@ -131,7 +131,7 @@ self.roomAvatar.layer.cornerRadius = self.roomAvatar.frame.size.width / 2; self.roomAvatar.clipsToBounds = YES; - self.roomAvatar.defaultBackgroundColor = ThemeService.theme.headerBackgroundColor; + self.roomAvatar.defaultBackgroundColor = ThemeService.shared.theme.headerBackgroundColor; // Force the layout of subviews to update the position of 'bottomBorderView' which is used to define the actual height of the preview container. [self layoutIfNeeded]; diff --git a/Riot/Modules/Room/Views/Title/Preview/PreviewRoomTitleView.m b/Riot/Modules/Room/Views/Title/Preview/PreviewRoomTitleView.m index f9f1970d8..fc4f74a7b 100644 --- a/Riot/Modules/Room/Views/Title/Preview/PreviewRoomTitleView.m +++ b/Riot/Modules/Room/Views/Title/Preview/PreviewRoomTitleView.m @@ -64,28 +64,28 @@ [super customizeViewRendering]; // Use same color as navigation bar - self.mainHeaderBackground.backgroundColor = ThemeService.theme.baseColor; + self.mainHeaderBackground.backgroundColor = ThemeService.shared.theme.baseColor; - self.roomTopic.textColor = ThemeService.theme.baseTextSecondaryColor; + self.roomTopic.textColor = ThemeService.shared.theme.baseTextSecondaryColor; - self.roomMembers.textColor = ThemeService.theme.tintColor; + self.roomMembers.textColor = ThemeService.shared.theme.tintColor; - self.previewLabel.textColor = ThemeService.theme.baseTextSecondaryColor; + self.previewLabel.textColor = ThemeService.shared.theme.baseTextSecondaryColor; self.previewLabel.numberOfLines = 0; - self.subNoticeLabel.textColor = ThemeService.theme.textSecondaryColor; + self.subNoticeLabel.textColor = ThemeService.shared.theme.textSecondaryColor; self.subNoticeLabel.numberOfLines = 0; - self.bottomBorderView.backgroundColor = ThemeService.theme.headerBackgroundColor; + self.bottomBorderView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; [self.leftButton.layer setCornerRadius:5]; self.leftButton.clipsToBounds = YES; - self.leftButton.backgroundColor = ThemeService.theme.tintColor; + self.leftButton.backgroundColor = ThemeService.shared.theme.tintColor; [self.rightButton.layer setCornerRadius:5]; self.rightButton.clipsToBounds = YES; - self.rightButton.backgroundColor = ThemeService.theme.tintColor; + self.rightButton.backgroundColor = ThemeService.shared.theme.tintColor; } - (void)refreshDisplay @@ -103,7 +103,7 @@ toFitViewSize:self.roomAvatar.frame.size withMethod:MXThumbnailingMethodCrop previewImage:[MXKTools paintImage:[UIImage imageNamed:@"placeholder"] - withColor:ThemeService.theme.tintColor] + withColor:ThemeService.shared.theme.tintColor] mediaManager:self.mxRoom.mxSession.mediaManager]; } else @@ -249,7 +249,7 @@ self.roomAvatar.layer.cornerRadius = self.roomAvatar.frame.size.width / 2; self.roomAvatar.clipsToBounds = YES; - self.roomAvatar.defaultBackgroundColor = ThemeService.theme.headerBackgroundColor; + self.roomAvatar.defaultBackgroundColor = ThemeService.shared.theme.headerBackgroundColor; // Force the layout of subviews to update the position of 'bottomBorderView' which is used to define the actual height of the preview container. [self layoutIfNeeded]; diff --git a/Riot/Modules/Room/Views/Title/RoomTitleView.m b/Riot/Modules/Room/Views/Title/RoomTitleView.m index 8eddd61e9..7b38994ae 100644 --- a/Riot/Modules/Room/Views/Title/RoomTitleView.m +++ b/Riot/Modules/Room/Views/Title/RoomTitleView.m @@ -73,7 +73,7 @@ [super layoutSubviews]; self.roomDetailsIconImageView.image = [MXKTools paintImage:self.roomDetailsIconImageView.image - withColor:ThemeService.theme.tintColor]; + withColor:ThemeService.shared.theme.tintColor]; if (self.superview) { @@ -138,8 +138,8 @@ [super customizeViewRendering]; // Use same color as navigation bar - self.backgroundColor = ThemeService.theme.baseColor; - self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? ThemeService.theme.baseTextPrimaryColor : ThemeService.theme.textSecondaryColor); + self.backgroundColor = ThemeService.shared.theme.baseColor; + self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? ThemeService.shared.theme.baseTextPrimaryColor : ThemeService.shared.theme.textSecondaryColor); } - (void)setRoomPreviewData:(RoomPreviewData *)roomPreviewData @@ -164,11 +164,11 @@ if (!self.displayNameTextField.text.length) { self.displayNameTextField.text = [NSBundle mxk_localizedStringForKey:@"room_displayname_empty_room"]; - self.displayNameTextField.textColor = ThemeService.theme.textSecondaryColor; + self.displayNameTextField.textColor = ThemeService.shared.theme.textSecondaryColor; } else { - self.displayNameTextField.textColor = ThemeService.theme.baseTextPrimaryColor; + self.displayNameTextField.textColor = ThemeService.shared.theme.baseTextPrimaryColor; } } } diff --git a/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m b/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m index 711e8b051..97c5cf0de 100644 --- a/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m +++ b/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m @@ -120,12 +120,12 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -136,7 +136,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)viewWillAppear:(BOOL)animated @@ -226,13 +226,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerDetailTableViewCell.m b/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerDetailTableViewCell.m index e897148bb..dfa59ad8e 100644 --- a/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerDetailTableViewCell.m +++ b/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerDetailTableViewCell.m @@ -25,7 +25,7 @@ { [super customizeTableViewCellRendering]; - self.detailDescLabel.textColor = ThemeService.theme.textSecondaryColor; + self.detailDescLabel.textColor = ThemeService.shared.theme.textSecondaryColor; } - (void)render:(id)cellData diff --git a/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerTableViewCell.m b/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerTableViewCell.m index 823415e1c..3c1ceeabe 100644 --- a/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerTableViewCell.m +++ b/Riot/Modules/Rooms/DirectoryPicker/Views/DirectoryServerTableViewCell.m @@ -29,7 +29,7 @@ { [super customizeTableViewCellRendering]; - self.descLabel.textColor = ThemeService.theme.textPrimaryColor; + self.descLabel.textColor = ThemeService.shared.theme.textPrimaryColor; } - (void)layoutSubviews @@ -64,7 +64,7 @@ withType:nil andImageOrientation:UIImageOrientationUp previewImage:[MXKTools paintImage:[UIImage imageNamed:@"placeholder"] - withColor:ThemeService.theme.tintColor] + withColor:ThemeService.shared.theme.tintColor] mediaManager:cellData.mediaManager]; } else diff --git a/Riot/Modules/Rooms/RoomsViewController.m b/Riot/Modules/Rooms/RoomsViewController.m index 4774d1cd2..47731c963 100644 --- a/Riot/Modules/Rooms/RoomsViewController.m +++ b/Riot/Modules/Rooms/RoomsViewController.m @@ -64,7 +64,7 @@ [super viewWillAppear:animated]; [AppDelegate theDelegate].masterTabBarController.navigationItem.title = NSLocalizedStringFromTable(@"title_rooms", @"Vector", nil); - [AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.theme.tintColor; + [AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.shared.theme.tintColor; if ([self.dataSource isKindOfClass:RecentsDataSource.class]) { diff --git a/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m b/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m index 17db945e3..1366854c7 100644 --- a/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m +++ b/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m @@ -109,7 +109,7 @@ static CGFloat const kTextFontSize = 15.0; - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } #pragma mark - Private @@ -123,22 +123,22 @@ static CGFloat const kTextFontSize = 15.0; - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; } - (void)setupStringAttributes { self.normalStringAttributes = @{ NSFontAttributeName: [UIFont systemFontOfSize:kTextFontSize], - NSForegroundColorAttributeName: ThemeService.theme.textPrimaryColor + NSForegroundColorAttributeName: ThemeService.shared.theme.textPrimaryColor }; self.emphasizeStringAttributes = @{ NSFontAttributeName: [UIFont systemFontOfSize:kTextFontSize weight:UIFontWeightBold], - NSForegroundColorAttributeName: ThemeService.theme.textPrimaryColor + NSForegroundColorAttributeName: ThemeService.shared.theme.textPrimaryColor }; } @@ -166,9 +166,9 @@ static CGFloat const kTextFontSize = 15.0; self.deactivateAcccountButton.titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; self.deactivateAcccountButton.layer.masksToBounds = YES; - self.deactivateAcccountButton.backgroundColor = ThemeService.theme.tintColor; + self.deactivateAcccountButton.backgroundColor = ThemeService.shared.theme.tintColor; [self.deactivateAcccountButton setTitle:NSLocalizedStringFromTable(@"deactivate_account_validate_action", @"Vector", nil) forState:UIControlStateNormal]; - [self.deactivateAcccountButton setTitleColor:ThemeService.theme.headerTextSecondaryColor forState:UIControlStateDisabled]; + [self.deactivateAcccountButton setTitleColor:ThemeService.shared.theme.headerTextSecondaryColor forState:UIControlStateDisabled]; } - (void)setupDeactivateAccountInfosLabel diff --git a/Riot/Modules/Settings/Language/LanguagePickerViewController.m b/Riot/Modules/Settings/Language/LanguagePickerViewController.m index 77170483f..915de9864 100644 --- a/Riot/Modules/Settings/Language/LanguagePickerViewController.m +++ b/Riot/Modules/Settings/Language/LanguagePickerViewController.m @@ -69,15 +69,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - [ThemeService.theme applyStyleOnSearchBar:self.searchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:self.searchBar]; // Use the primary bg color for the table view in plain style. - self.tableView.backgroundColor = ThemeService.theme.backgroundColor; - topview.backgroundColor = ThemeService.theme.backgroundColor; + self.tableView.backgroundColor = ThemeService.shared.theme.backgroundColor; + topview.backgroundColor = ThemeService.shared.theme.backgroundColor; if (self.tableView.dataSource) { @@ -87,7 +87,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -114,15 +114,15 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; - cell.detailTextLabel.textColor = ThemeService.theme.textSecondaryColor; - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + cell.detailTextLabel.textColor = ThemeService.shared.theme.textSecondaryColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m b/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m index 45e66a73f..ef7943c5f 100644 --- a/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m +++ b/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m @@ -72,15 +72,15 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; - [ThemeService.theme applyStyleOnSearchBar:self.searchBar]; + [ThemeService.shared.theme applyStyleOnSearchBar:self.searchBar]; // Use the primary bg color for the table view in plain style. - self.tableView.backgroundColor = ThemeService.theme.backgroundColor; - topview.backgroundColor = ThemeService.theme.backgroundColor; + self.tableView.backgroundColor = ThemeService.shared.theme.backgroundColor; + topview.backgroundColor = ThemeService.shared.theme.backgroundColor; self.searchDisplayController.searchResultsTableView.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -91,7 +91,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)viewWillAppear:(BOOL)animated @@ -118,15 +118,15 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; - cell.detailTextLabel.textColor = ThemeService.theme.textSecondaryColor; - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + cell.detailTextLabel.textColor = ThemeService.shared.theme.textSecondaryColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 275fdf265..cf29b7e83 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -334,12 +334,12 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -350,7 +350,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)didReceiveMemoryWarning @@ -955,30 +955,30 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); // Crypto information NSMutableAttributedString *cryptoInformationString = [[NSMutableAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"settings_crypto_device_name", @"Vector", nil) - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor, NSFontAttributeName: [UIFont systemFontOfSize:17]}]; [cryptoInformationString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:account.device.displayName ? account.device.displayName : @"" - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor, NSFontAttributeName: [UIFont systemFontOfSize:17]}]]; [cryptoInformationString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"settings_crypto_device_id", @"Vector", nil) - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor, NSFontAttributeName: [UIFont systemFontOfSize:17]}]]; [cryptoInformationString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:account.device.deviceId ? account.device.deviceId : @"" - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor, NSFontAttributeName: [UIFont systemFontOfSize:17]}]]; [cryptoInformationString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"settings_crypto_device_key", @"Vector", nil) - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor, NSFontAttributeName: [UIFont systemFontOfSize:17]}]]; NSString *fingerprint = account.mxSession.crypto.deviceEd25519Key; [cryptoInformationString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:fingerprint ? fingerprint : @"" - attributes:@{NSForegroundColorAttributeName : ThemeService.theme.textPrimaryColor, + attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:17]}]]; return cryptoInformationString; @@ -1295,12 +1295,12 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); cell.mxkTextFieldLeadingConstraint.constant = 16; cell.mxkTextFieldTrailingConstraint.constant = 15; - cell.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.mxkTextField.userInteractionEnabled = YES; cell.mxkTextField.borderStyle = UITextBorderStyleNone; cell.mxkTextField.textAlignment = NSTextAlignmentRight; - cell.mxkTextField.textColor = ThemeService.theme.textSecondaryColor; + cell.mxkTextField.textColor = ThemeService.shared.theme.textSecondaryColor; cell.mxkTextField.font = [UIFont systemFontOfSize:16]; cell.mxkTextField.placeholder = nil; @@ -1322,7 +1322,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); cell.mxkLabelLeadingConstraint.constant = cell.separatorInset.left; cell.mxkSwitchTrailingConstraint.constant = 15; - cell.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; [cell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -1348,7 +1348,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); } cell.textLabel.accessibilityIdentifier = nil; cell.textLabel.font = [UIFont systemFontOfSize:17]; - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; return cell; } @@ -1357,7 +1357,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); { MXKTableViewCellWithTextView *textViewCell = [tableView dequeueReusableCellWithIdentifier:[MXKTableViewCellWithTextView defaultReuseIdentifier] forIndexPath:indexPath]; - textViewCell.mxkTextView.textColor = ThemeService.theme.textPrimaryColor; + textViewCell.mxkTextView.textColor = ThemeService.shared.theme.textPrimaryColor; textViewCell.mxkTextView.font = [UIFont systemFontOfSize:17]; textViewCell.mxkTextView.backgroundColor = [UIColor clearColor]; textViewCell.mxkTextViewLeadingConstraint.constant = tableView.separatorInset.left; @@ -1404,7 +1404,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); [signOutCell.mxkButton setTitle:title forState:UIControlStateNormal]; [signOutCell.mxkButton setTitle:title forState:UIControlStateHighlighted]; - [signOutCell.mxkButton setTintColor:ThemeService.theme.tintColor]; + [signOutCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor]; signOutCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17]; [signOutCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -1436,7 +1436,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); profileCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_profile_picture", @"Vector", nil); profileCell.accessibilityIdentifier=@"SettingsVCProfilPictureStaticText"; - profileCell.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; + profileCell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; // if the user defines a new avatar if (newAvatarImage) @@ -1527,11 +1527,11 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); { newEmailCell.mxkLabel.text = nil; newEmailCell.mxkTextField.placeholder = NSLocalizedStringFromTable(@"settings_email_address_placeholder", @"Vector", nil); - if (ThemeService.theme.placeholderTextColor) + if (ThemeService.shared.theme.placeholderTextColor) { newEmailCell.mxkTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:newEmailCell.mxkTextField.placeholder - attributes:@{NSForegroundColorAttributeName: ThemeService.theme.placeholderTextColor}]; + attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; } newEmailCell.mxkTextField.text = newEmailTextField.text; newEmailCell.mxkTextField.userInteractionEnabled = YES; @@ -1559,7 +1559,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); newEmailTextField = newEmailCell.mxkTextField; } - UIImage *accessoryViewImage = [MXKTools paintImage:[UIImage imageNamed:@"plus_icon"] withColor:ThemeService.theme.tintColor]; + UIImage *accessoryViewImage = [MXKTools paintImage:[UIImage imageNamed:@"plus_icon"] withColor:ThemeService.shared.theme.tintColor]; newEmailCell.accessoryView = [[UIImageView alloc] initWithImage:accessoryViewImage]; } @@ -1652,7 +1652,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); newPhoneNumberCell = newPhoneCell; } - UIImage *accessoryViewImage = [MXKTools paintImage:[UIImage imageNamed:@"plus_icon"] withColor:ThemeService.theme.tintColor]; + UIImage *accessoryViewImage = [MXKTools paintImage:[UIImage imageNamed:@"plus_icon"] withColor:ThemeService.shared.theme.tintColor]; newPhoneCell.accessoryView = [[UIImageView alloc] initWithImage:accessoryViewImage]; cell = newPhoneCell; @@ -1672,7 +1672,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); else if (row == userSettingsNightModeSepIndex) { UITableViewCell *sepCell = [[UITableViewCell alloc] init]; - sepCell.backgroundColor = ThemeService.theme.headerBackgroundColor; + sepCell.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; cell = sepCell; } @@ -1695,7 +1695,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_enable_push_notif", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = account.isPushKitNotificationActive; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(togglePushNotifications:) forControlEvents:UIControlEventTouchUpInside]; @@ -1707,7 +1707,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_show_decrypted_content", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.showDecryptedContentInNotifications; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = account.isPushKitNotificationActive; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleShowDecodedContent:) forControlEvents:UIControlEventTouchUpInside]; @@ -1733,7 +1733,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_pin_rooms_with_missed_notif", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.pinRoomsWithMissedNotificationsOnHome; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(togglePinRoomsWithMissedNotif:) forControlEvents:UIControlEventTouchUpInside]; @@ -1745,7 +1745,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_pin_rooms_with_unread", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.pinRoomsWithUnreadMessagesOnHome; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(togglePinRoomsWithUnread:) forControlEvents:UIControlEventTouchUpInside]; @@ -1759,7 +1759,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_enable_callkit", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = [MXKAppSettings standardAppSettings].isCallKitEnabled; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleCallKit:) forControlEvents:UIControlEventTouchUpInside]; @@ -1796,7 +1796,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:language]; languageDescription = [languageDescription capitalizedStringWithLocale:locale]; - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.textLabel.text = NSLocalizedStringFromTable(@"settings_ui_language", @"Vector", nil); cell.detailTextLabel.text = languageDescription; @@ -1833,7 +1833,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); @"Vector", nil); - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.textLabel.text = NSLocalizedStringFromTable(@"settings_ui_theme", @"Vector", nil); cell.detailTextLabel.text = i18nTheme; @@ -1864,7 +1864,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.numberOfLines = 0; labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_contacts_discover_matrix_users", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = [MXKAppSettings standardAppSettings].syncLocalContacts; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLocalContactsSync:) forControlEvents:UIControlEventTouchUpInside]; @@ -1882,7 +1882,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); NSLocale *local = [[NSLocale alloc] initWithLocaleIdentifier:[[NSBundle mainBundle] preferredLocalizations][0]]; NSString *countryName = [local displayNameForKey:NSLocaleCountryCode value:countryCode]; - cell.textLabel.textColor = ThemeService.theme.textPrimaryColor; + cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; cell.textLabel.text = NSLocalizedStringFromTable(@"settings_contacts_phonebook_country", @"Vector", nil); cell.detailTextLabel.text = countryName; @@ -1973,7 +1973,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); sendCrashReportCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_send_crash_report", @"Vector", nil); sendCrashReportCell.mxkSwitch.on = RiotSettings.shared.enableCrashReport; - sendCrashReportCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + sendCrashReportCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; sendCrashReportCell.mxkSwitch.enabled = YES; [sendCrashReportCell.mxkSwitch addTarget:self action:@selector(toggleSendCrashReport:) forControlEvents:UIControlEventTouchUpInside]; @@ -1985,7 +1985,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); enableRageShakeCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_enable_rageshake", @"Vector", nil); enableRageShakeCell.mxkSwitch.on = RiotSettings.shared.enableRageShake; - enableRageShakeCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + enableRageShakeCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; enableRageShakeCell.mxkSwitch.enabled = YES; [enableRageShakeCell.mxkSwitch addTarget:self action:@selector(toggleEnableRageShake:) forControlEvents:UIControlEventTouchUpInside]; @@ -2007,7 +2007,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); NSString *btnTitle = NSLocalizedStringFromTable(@"settings_mark_all_as_read", @"Vector", nil); [markAllBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateNormal]; [markAllBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateHighlighted]; - [markAllBtnCell.mxkButton setTintColor:ThemeService.theme.tintColor]; + [markAllBtnCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor]; markAllBtnCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17]; [markAllBtnCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -2032,7 +2032,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); NSString *btnTitle = NSLocalizedStringFromTable(@"settings_clear_cache", @"Vector", nil); [clearCacheBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateNormal]; [clearCacheBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateHighlighted]; - [clearCacheBtnCell.mxkButton setTintColor:ThemeService.theme.tintColor]; + [clearCacheBtnCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor]; clearCacheBtnCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17]; [clearCacheBtnCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -2057,7 +2057,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); NSString *btnTitle = NSLocalizedStringFromTable(@"settings_report_bug", @"Vector", nil); [reportBugBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateNormal]; [reportBugBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateHighlighted]; - [reportBugBtnCell.mxkButton setTintColor:ThemeService.theme.tintColor]; + [reportBugBtnCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor]; reportBugBtnCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17]; [reportBugBtnCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -2077,7 +2077,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); MXKAccount* account = [MXKAccountManager sharedManager].activeAccounts.firstObject; labelAndSwitchCell.mxkSwitch.on = account.mxSession.syncWithLazyLoadOfRoomMembers; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleSyncWithLazyLoadOfRoomMembers:) forControlEvents:UIControlEventTouchUpInside]; @@ -2089,7 +2089,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_create_conference_with_jitsi", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.createConferenceCallsWithJitsi; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleJitsiForConference:) forControlEvents:UIControlEventTouchUpInside]; @@ -2103,7 +2103,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_e2e_encryption", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = (nil != session.crypto); - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsEndToEndEncryption:) forControlEvents:UIControlEventTouchUpInside]; @@ -2177,7 +2177,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_crypto_blacklist_unverified_devices", @"Vector", nil); labelAndSwitchCell.mxkSwitch.on = account.mxSession.crypto.globalBlacklistUnverifiedDevices; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.theme.tintColor; + labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; labelAndSwitchCell.mxkSwitch.enabled = YES; [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleBlacklistUnverifiedDevices:) forControlEvents:UIControlEventTouchUpInside]; @@ -2199,7 +2199,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); NSString *btnTitle = NSLocalizedStringFromTable(@"settings_crypto_export", @"Vector", nil); [exportKeysBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateNormal]; [exportKeysBtnCell.mxkButton setTitle:btnTitle forState:UIControlStateHighlighted]; - [exportKeysBtnCell.mxkButton setTintColor:ThemeService.theme.tintColor]; + [exportKeysBtnCell.mxkButton setTintColor:ThemeService.shared.theme.tintColor]; exportKeysBtnCell.mxkButton.titleLabel.font = [UIFont systemFontOfSize:17]; [exportKeysBtnCell.mxkButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; @@ -2334,7 +2334,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); { // Customize label style UITableViewHeaderFooterView *tableViewHeaderFooterView = (UITableViewHeaderFooterView*)view; - tableViewHeaderFooterView.textLabel.textColor = ThemeService.theme.textPrimaryColor; + tableViewHeaderFooterView.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor; tableViewHeaderFooterView.textLabel.font = [UIFont systemFontOfSize:15]; } } @@ -2362,15 +2362,15 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; if (cell.selectionStyle != UITableViewCellSelectionStyleNone) { // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -2473,7 +2473,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); }]; - leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_pink" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(50, cellHeight) resourceSize:CGSizeMake(24, 24)]; + leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon_pink" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(50, cellHeight) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:leaveAction atIndex:0]; } } diff --git a/Riot/Modules/Settings/Views/DeviceView.m b/Riot/Modules/Settings/Views/DeviceView.m index 6a3f3c7fa..7f1325990 100644 --- a/Riot/Modules/Settings/Views/DeviceView.m +++ b/Riot/Modules/Settings/Views/DeviceView.m @@ -28,12 +28,12 @@ { [super customizeViewRendering]; - self.containerView.backgroundColor = ThemeService.theme.headerBackgroundColor; - self.textView.backgroundColor = ThemeService.theme.backgroundColor; - self.defaultTextColor = ThemeService.theme.textPrimaryColor; - self.cancelButton.tintColor = ThemeService.theme.tintColor; - self.deleteButton.tintColor = ThemeService.theme.tintColor; - self.renameButton.tintColor = ThemeService.theme.tintColor; + self.containerView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor; + self.textView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.defaultTextColor = ThemeService.shared.theme.textPrimaryColor; + self.cancelButton.tintColor = ThemeService.shared.theme.tintColor; + self.deleteButton.tintColor = ThemeService.shared.theme.tintColor; + self.renameButton.tintColor = ThemeService.shared.theme.tintColor; } @end diff --git a/Riot/Modules/Settings/Views/TableViewCellWithPhoneNumberTextField.m b/Riot/Modules/Settings/Views/TableViewCellWithPhoneNumberTextField.m index a265e50b1..9db346839 100644 --- a/Riot/Modules/Settings/Views/TableViewCellWithPhoneNumberTextField.m +++ b/Riot/Modules/Settings/Views/TableViewCellWithPhoneNumberTextField.m @@ -27,10 +27,10 @@ { [super customizeTableViewCellRendering]; - self.mxkLabel.textColor = ThemeService.theme.textPrimaryColor; - self.mxkTextField.textColor = ThemeService.theme.textPrimaryColor; + self.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor; + self.mxkTextField.textColor = ThemeService.shared.theme.textPrimaryColor; - _isoCountryCodeLabel.textColor = ThemeService.theme.textPrimaryColor; + _isoCountryCodeLabel.textColor = ThemeService.shared.theme.textPrimaryColor; } - (void)setIsoCountryCode:(NSString *)isoCountryCode diff --git a/Riot/Modules/StartChat/StartChatViewController.m b/Riot/Modules/StartChat/StartChatViewController.m index 8faca7478..cbc7dabf4 100644 --- a/Riot/Modules/StartChat/StartChatViewController.m +++ b/Riot/Modules/StartChat/StartChatViewController.m @@ -149,10 +149,10 @@ [self refreshSearchBarItemsColor:_searchBarView]; - _searchBarHeaderBorder.backgroundColor = ThemeService.theme.headerBorderColor; + _searchBarHeaderBorder.backgroundColor = ThemeService.shared.theme.headerBorderColor; // Check the table view style to select its bg color. - self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.contactsTableView.backgroundColor; if (self.contactsTableView.dataSource) @@ -163,7 +163,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -381,13 +381,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { @@ -453,7 +453,7 @@ }]; - leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; + leaveAction.backgroundColor = [MXKTools convertImageToPatternColor:@"remove_icon" backgroundColor:ThemeService.shared.theme.headerBackgroundColor patternSize:CGSizeMake(74, 74) resourceSize:CGSizeMake(24, 24)]; [actions insertObject:leaveAction atIndex:0]; } @@ -621,19 +621,19 @@ - (void)refreshSearchBarItemsColor:(UISearchBar *)searchBar { // bar tint color - searchBar.barTintColor = searchBar.tintColor = ThemeService.theme.tintColor; - searchBar.tintColor = ThemeService.theme.tintColor; + searchBar.barTintColor = searchBar.tintColor = ThemeService.shared.theme.tintColor; + searchBar.tintColor = ThemeService.shared.theme.tintColor; // FIXME: this all seems incredibly fragile and tied to gutwrenching the current UISearchBar internals. // text color UITextField *searchBarTextField = [searchBar valueForKey:@"_searchField"]; - searchBarTextField.textColor = ThemeService.theme.textSecondaryColor; + searchBarTextField.textColor = ThemeService.shared.theme.textSecondaryColor; // Magnifying glass icon. UIImageView *leftImageView = (UIImageView *)searchBarTextField.leftView; leftImageView.image = [leftImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - leftImageView.tintColor = ThemeService.theme.tintColor; + leftImageView.tintColor = ThemeService.shared.theme.tintColor; // remove the gray background color UIView *effectBackgroundTop = [searchBarTextField valueForKey:@"_effectBackgroundTop"]; @@ -646,8 +646,8 @@ { searchBarTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:searchBarTextField.placeholder attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), - NSUnderlineColorAttributeName: ThemeService.theme.tintColor, - NSForegroundColorAttributeName: ThemeService.theme.tintColor}]; + NSUnderlineColorAttributeName: ThemeService.shared.theme.tintColor, + NSForegroundColorAttributeName: ThemeService.shared.theme.tintColor}]; } } diff --git a/Riot/Modules/TabBar/MasterTabBarController.m b/Riot/Modules/TabBar/MasterTabBarController.m index 114a7068c..2d89150c7 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.m +++ b/Riot/Modules/TabBar/MasterTabBarController.m @@ -114,19 +114,19 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.tabBar.tintColor = ThemeService.theme.tintColor; - self.tabBar.barTintColor = ThemeService.theme.headerBackgroundColor; + self.tabBar.tintColor = ThemeService.shared.theme.tintColor; + self.tabBar.barTintColor = ThemeService.shared.theme.headerBackgroundColor; - self.view.backgroundColor = ThemeService.theme.backgroundColor; + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; [self setNeedsStatusBarAppearanceUpdate]; } - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)viewWillAppear:(BOOL)animated @@ -786,7 +786,7 @@ { _hidden = hidden; - [self.view superview].backgroundColor = ThemeService.theme.backgroundColor; + [self.view superview].backgroundColor = ThemeService.shared.theme.backgroundColor; self.view.hidden = hidden; self.navigationController.navigationBar.hidden = hidden; } @@ -798,15 +798,15 @@ // Use a middle dot to signal missed notif in favourites [self setMissedDiscussionsMark:(recentsDataSource.missedFavouriteDiscussionsCount? @"\u00B7": nil) onTabBarItem:TABBAR_FAVOURITES_INDEX - withBadgeColor:(recentsDataSource.missedHighlightFavouriteDiscussionsCount ? ThemeService.theme.notificationMentionColor : ThemeService.theme.notificationUnreadColor)]; + withBadgeColor:(recentsDataSource.missedHighlightFavouriteDiscussionsCount ? ThemeService.shared.theme.notificationMentionColor : ThemeService.shared.theme.notificationUnreadColor)]; // Update the badge on People and Rooms tabs [self setMissedDiscussionsCount:recentsDataSource.missedDirectDiscussionsCount onTabBarItem:TABBAR_PEOPLE_INDEX - withBadgeColor:(recentsDataSource.missedHighlightDirectDiscussionsCount ? ThemeService.theme.notificationMentionColor : ThemeService.theme.notificationUnreadColor)]; + withBadgeColor:(recentsDataSource.missedHighlightDirectDiscussionsCount ? ThemeService.shared.theme.notificationMentionColor : ThemeService.shared.theme.notificationUnreadColor)]; [self setMissedDiscussionsCount:recentsDataSource.missedGroupDiscussionsCount onTabBarItem:TABBAR_ROOMS_INDEX - withBadgeColor:(recentsDataSource.missedHighlightGroupDiscussionsCount ? ThemeService.theme.notificationMentionColor : ThemeService.theme.notificationUnreadColor)]; + withBadgeColor:(recentsDataSource.missedHighlightGroupDiscussionsCount ? ThemeService.shared.theme.notificationMentionColor : ThemeService.shared.theme.notificationUnreadColor)]; } - (void)setMissedDiscussionsCount:(NSUInteger)count onTabBarItem:(NSUInteger)index withBadgeColor:(UIColor*)badgeColor diff --git a/Riot/Modules/UserDevices/UsersDevicesViewController.m b/Riot/Modules/UserDevices/UsersDevicesViewController.m index 3e288dfed..132627553 100644 --- a/Riot/Modules/UserDevices/UsersDevicesViewController.m +++ b/Riot/Modules/UserDevices/UsersDevicesViewController.m @@ -82,12 +82,12 @@ - (void)userInterfaceThemeDidChange { - [ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; + [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor; + self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? ThemeService.shared.theme.backgroundColor : ThemeService.shared.theme.headerBackgroundColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -98,7 +98,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle { - return ThemeService.theme.statusBarStyle; + return ThemeService.shared.theme.statusBarStyle; } - (void)destroy @@ -178,13 +178,13 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = ThemeService.theme.backgroundColor; + cell.backgroundColor = ThemeService.shared.theme.backgroundColor; // Update the selected background view - if (ThemeService.theme.selectedBackgroundColor) + if (ThemeService.shared.theme.selectedBackgroundColor) { cell.selectedBackgroundView = [[UIView alloc] init]; - cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor; + cell.selectedBackgroundView.backgroundColor = ThemeService.shared.theme.selectedBackgroundColor; } else { diff --git a/Riot/Modules/UserDevices/Views/DeviceTableViewCell.m b/Riot/Modules/UserDevices/Views/DeviceTableViewCell.m index 77ba00d6b..9ee73a778 100644 --- a/Riot/Modules/UserDevices/Views/DeviceTableViewCell.m +++ b/Riot/Modules/UserDevices/Views/DeviceTableViewCell.m @@ -32,15 +32,15 @@ { [super customizeTableViewCellRendering]; - self.deviceName.textColor = ThemeService.theme.textPrimaryColor; + self.deviceName.textColor = ThemeService.shared.theme.textPrimaryColor; [self.verifyButton.layer setCornerRadius:5]; self.verifyButton.clipsToBounds = YES; - self.verifyButton.backgroundColor = ThemeService.theme.tintColor; + self.verifyButton.backgroundColor = ThemeService.shared.theme.tintColor; [self.blockButton.layer setCornerRadius:5]; self.blockButton.clipsToBounds = YES; - self.blockButton.backgroundColor = ThemeService.theme.tintColor; + self.blockButton.backgroundColor = ThemeService.shared.theme.tintColor; } - (void)render:(MXDeviceInfo *)deviceInfo diff --git a/Riot/Utils/AvatarGenerator.m b/Riot/Utils/AvatarGenerator.m index 6b9ad57a9..dc0162ef3 100644 --- a/Riot/Utils/AvatarGenerator.m +++ b/Riot/Utils/AvatarGenerator.m @@ -39,7 +39,7 @@ static UILabel* backgroundLabel = nil; { if (!colorsList) { - colorsList = ThemeService.theme.avatarColors; + colorsList = ThemeService.shared.theme.avatarColors; } } @@ -93,7 +93,7 @@ static UILabel* backgroundLabel = nil; if (!backgroundLabel) { backgroundLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - backgroundLabel.textColor = ThemeService.theme.backgroundColor; + backgroundLabel.textColor = ThemeService.shared.theme.backgroundColor; backgroundLabel.textAlignment = NSTextAlignmentCenter; backgroundLabel.font = [UIFont boldSystemFontOfSize:25]; } @@ -123,7 +123,7 @@ static UILabel* backgroundLabel = nil; + (UIImage *)imageFromText:(NSString*)text withBackgroundColor:(UIColor*)color size:(CGFloat)size andFontSize:(CGFloat)fontSize { UILabel *bgLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size, size)]; - bgLabel.textColor = ThemeService.theme.backgroundColor; + bgLabel.textColor = ThemeService.shared.theme.backgroundColor; bgLabel.textAlignment = NSTextAlignmentCenter; bgLabel.font = [UIFont boldSystemFontOfSize:fontSize]; diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index 36e8b88d1..a6bffccc1 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -206,7 +206,7 @@ NSString *const kEventFormatterOnReRequestKeysLinkActionSeparator = @"/"; calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; // Use the secondary bg color to set the background color in the default CSS. - NSUInteger bgColor = [MXKTools rgbValueWithColor:ThemeService.theme.headerBackgroundColor]; + NSUInteger bgColor = [MXKTools rgbValueWithColor:ThemeService.shared.theme.headerBackgroundColor]; self.defaultCSS = [NSString stringWithFormat:@" \ pre,code { \ background-color: #%06lX; \ @@ -217,12 +217,12 @@ NSString *const kEventFormatterOnReRequestKeysLinkActionSeparator = @"/"; font-size: small; \ }", (unsigned long)bgColor]; - self.defaultTextColor = ThemeService.theme.textPrimaryColor; - self.subTitleTextColor = ThemeService.theme.textSecondaryColor; - self.prefixTextColor = ThemeService.theme.textSecondaryColor; - self.bingTextColor = ThemeService.theme.notificationMentionColor; - self.encryptingTextColor = ThemeService.theme.tintColor; - self.sendingTextColor = ThemeService.theme.textSecondaryColor; + self.defaultTextColor = ThemeService.shared.theme.textPrimaryColor; + self.subTitleTextColor = ThemeService.shared.theme.textSecondaryColor; + self.prefixTextColor = ThemeService.shared.theme.textSecondaryColor; + self.bingTextColor = ThemeService.shared.theme.notificationMentionColor; + self.encryptingTextColor = ThemeService.shared.theme.tintColor; + self.sendingTextColor = ThemeService.shared.theme.textSecondaryColor; self.errorTextColor = kRiotColorRed; self.defaultTextFont = [UIFont systemFontOfSize:15]; diff --git a/RiotShareExtension/Modules/Fallback/FallbackViewController.m b/RiotShareExtension/Modules/Fallback/FallbackViewController.m index 19b7165b6..42d213e82 100644 --- a/RiotShareExtension/Modules/Fallback/FallbackViewController.m +++ b/RiotShareExtension/Modules/Fallback/FallbackViewController.m @@ -35,7 +35,7 @@ { [super viewDidLoad]; - self.titleLabel.textColor = ThemeService.theme.textSecondaryColor; + self.titleLabel.textColor = ThemeService.shared.theme.textSecondaryColor; self.titleLabel.text = NSLocalizedStringFromTable(@"share_extension_auth_prompt", @"Vector", nil); } diff --git a/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m b/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m index 1f324bd7d..2242cb599 100644 --- a/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m +++ b/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m @@ -96,7 +96,7 @@ self.recentsSearchBar.searchBarStyle = UISearchBarStyleMinimal; self.recentsSearchBar.placeholder = NSLocalizedStringFromTable(@"search_default_placeholder", @"Vector", nil); - self.recentsSearchBar.tintColor = ThemeService.theme.tintColor; + self.recentsSearchBar.tintColor = ThemeService.shared.theme.tintColor; _tableSearchBar.tintColor = self.recentsSearchBar.tintColor; }