reskin: Create ThemeService.shared

This commit is contained in:
manuroe 2019-01-11 11:45:27 +01:00
parent b3b6e2c80c
commit 744208ae25
112 changed files with 758 additions and 728 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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>)theme;
@property (nonatomic, readonly) id<Theme> theme;
/**
Get the theme with the given id.
@param themeId the theme id.
@return the theme.
*/
- (id<Theme>)themeWithThemeId:(NSString*)themeId;
@end

View file

@ -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<Theme>)themeWithThemeId:(NSString*)themeId
{
// Use light theme colors by default.
id<Theme> 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>)theme
{
id<Theme> 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

View file

@ -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

View file

@ -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];

View file

@ -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}];
}
}
}

View file

@ -80,7 +80,7 @@ final class TermsView: UIView, NibOwnerLoadable, UITableViewDelegate, UITableVie
}
func customizeViewRendering() {
acceptButton.backgroundColor = ThemeService.theme().tintColor
acceptButton.backgroundColor = ThemeService.shared().theme.tintColor
}

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -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;
}

View file

@ -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);

View file

@ -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:)])

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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];
}

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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];
}

View file

@ -122,7 +122,7 @@
- (UIStatusBarStyle)preferredStatusBarStyle
{
return ThemeService.theme.statusBarStyle;
return ThemeService.shared.theme.statusBarStyle;
}
- (BOOL)prefersStatusBarHidden

View file

@ -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

View file

@ -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];

View file

@ -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
{

View file

@ -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"];

View file

@ -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
{

View file

@ -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;

View file

@ -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];
}
}

View file

@ -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

View file

@ -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
{

View file

@ -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];
}

View file

@ -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];

View file

@ -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
{

View file

@ -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

View file

@ -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

View file

@ -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
{

View file

@ -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;
}
}

View file

@ -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

View file

@ -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;

View file

@ -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;
}

View file

@ -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];

View file

@ -32,7 +32,7 @@
{
[super customizeTableViewCellRendering];
self.editionView.backgroundColor = ThemeService.theme.headerBackgroundColor;
self.editionView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor;
}
- (void)prepareForReuse

View file

@ -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

View file

@ -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
{

View file

@ -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

View file

@ -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

View file

@ -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;
}

View file

@ -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];
}

View file

@ -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

View file

@ -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;

View file

@ -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
{

View file

@ -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
{

View file

@ -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

View file

@ -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
{

View file

@ -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)

View file

@ -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];

View file

@ -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
{

View file

@ -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
{

View file

@ -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;
}
}

View file

@ -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];
}

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
_label.textColor = ThemeService.theme.textPrimaryColor;
_label.textColor = ThemeService.shared.theme.textPrimaryColor;
}
- (void)setEnabled:(BOOL)enabled

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
@end

View file

@ -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

View file

@ -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

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
@end

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
@end

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
@end

View file

@ -41,7 +41,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
- (void)prepareForReuse

View file

@ -30,7 +30,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
- (void)layoutSubviews

View file

@ -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

View file

@ -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];
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
- (void)render:(MXKCellData *)cellData

View file

@ -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

View file

@ -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

View file

@ -26,7 +26,7 @@
{
[super customizeTableViewCellRendering];
self.messageTextView.tintColor = ThemeService.theme.tintColor;
self.messageTextView.tintColor = ThemeService.shared.theme.tintColor;
}
@end

View file

@ -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

View file

@ -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];
}

View file

@ -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

View file

@ -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;
}

View file

@ -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 -

View file

@ -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];

View file

@ -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];

View file

@ -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;
}
}
}

View file

@ -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
{

View file

@ -25,7 +25,7 @@
{
[super customizeTableViewCellRendering];
self.detailDescLabel.textColor = ThemeService.theme.textSecondaryColor;
self.detailDescLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
}
- (void)render:(id<MXKDirectoryServerCellDataStoring>)cellData

View file

@ -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

View file

@ -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])
{

View file

@ -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

View file

@ -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
{

Some files were not shown because too many files have changed in this diff Show more