reskin: Rename RiotDesignValues -> ThemeService

This commit is contained in:
manuroe
2019-01-11 10:32:56 +01:00
parent 192d04fcbd
commit f0c22a14af
123 changed files with 992 additions and 1004 deletions

View File

@@ -32,8 +32,8 @@
// Observe kAppDelegateDidTapStatusBarNotification to handle tap on clock status bar.
id kAppDelegateDidTapStatusBarNotificationObserver;
// Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
id kRiotDesignValuesDidChangeThemeNotificationObserver;
// Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change.
id kThemeServiceDidChangeThemeNotificationObserver;
}
@end
@@ -62,7 +62,7 @@
self.searchTableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
// Observe user interface theme change.
kRiotDesignValuesDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kRiotDesignValuesDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
kThemeServiceDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kThemeServiceDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self userInterfaceThemeDidChange];
@@ -72,15 +72,15 @@
- (void)userInterfaceThemeDidChange
{
[RiotDesignValues.theme applyStyleOnNavigationBar:self.navigationController.navigationBar];
[ThemeService.theme applyStyleOnNavigationBar:self.navigationController.navigationBar];
self.activityIndicator.backgroundColor = RiotDesignValues.theme.overlayBackgroundColor;
self.activityIndicator.backgroundColor = ThemeService.theme.overlayBackgroundColor;
// Check the table view style to select its bg color.
self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : RiotDesignValues.theme.headerBackgroundColor);
self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? ThemeService.theme.backgroundColor : ThemeService.theme.headerBackgroundColor);
self.view.backgroundColor = self.searchTableView.backgroundColor;
self.noResultsLabel.textColor = RiotDesignValues.theme.backgroundColor;
self.noResultsLabel.textColor = ThemeService.theme.backgroundColor;
if (self.searchTableView.dataSource)
{
@@ -90,17 +90,17 @@
- (UIStatusBarStyle)preferredStatusBarStyle
{
return RiotDesignValues.theme.statusBarStyle;
return ThemeService.theme.statusBarStyle;
}
- (void)destroy
{
[super destroy];
if (kRiotDesignValuesDidChangeThemeNotificationObserver)
if (kThemeServiceDidChangeThemeNotificationObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver];
kRiotDesignValuesDidChangeThemeNotificationObserver = nil;
[[NSNotificationCenter defaultCenter] removeObserver:kThemeServiceDidChangeThemeNotificationObserver];
kThemeServiceDidChangeThemeNotificationObserver = nil;
}
}
@@ -146,13 +146,13 @@
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;
{
cell.backgroundColor = RiotDesignValues.theme.backgroundColor;
cell.backgroundColor = ThemeService.theme.backgroundColor;
// Update the selected background view
if (RiotDesignValues.theme.selectedBackgroundColor)
if (ThemeService.theme.selectedBackgroundColor)
{
cell.selectedBackgroundView = [[UIView alloc] init];
cell.selectedBackgroundView.backgroundColor = RiotDesignValues.theme.selectedBackgroundColor;
cell.selectedBackgroundView.backgroundColor = ThemeService.theme.selectedBackgroundColor;
}
else
{