mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Prepare Dark Theme
Observe user interface theme change. https://github.com/vector-im/riot-meta/issues/22
This commit is contained in:
@@ -26,6 +26,16 @@
|
||||
|
||||
#import "EventFormatter.h"
|
||||
|
||||
@interface HomeFilesSearchViewController()
|
||||
{
|
||||
/**
|
||||
Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
|
||||
*/
|
||||
id kRiotDesignValuesDidChangeThemeNotificationObserver;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation HomeFilesSearchViewController
|
||||
|
||||
- (void)finalizeInit
|
||||
@@ -33,7 +43,6 @@
|
||||
[super finalizeInit];
|
||||
|
||||
// Setup `MXKViewControllerHandling` properties
|
||||
self.defaultBarTintColor = kRiotNavBarTintColor;
|
||||
self.enableBarTintColorStatusChange = NO;
|
||||
self.rageShakeManager = [RageShakeManager sharedManager];
|
||||
}
|
||||
@@ -49,6 +58,30 @@
|
||||
|
||||
// Hide line separators of empty cells
|
||||
self.searchTableView.tableFooterView = [[UIView alloc] init];
|
||||
|
||||
// Observe user interface theme change.
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kRiotDesignValuesDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
|
||||
[self userInterfaceThemeDidChange];
|
||||
|
||||
}];
|
||||
[self userInterfaceThemeDidChange];
|
||||
}
|
||||
|
||||
- (void)userInterfaceThemeDidChange
|
||||
{
|
||||
self.defaultBarTintColor = kRiotSecondaryBgColor;
|
||||
}
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
[super destroy];
|
||||
|
||||
if (kRiotDesignValuesDidChangeThemeNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver];
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
|
||||
Reference in New Issue
Block a user