reskin: Create ThemeService.shared

This commit is contained in:
manuroe
2019-01-11 11:45:27 +01:00
parent 712a632120
commit 744a0b8d4f
112 changed files with 758 additions and 728 deletions
@@ -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
{