mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 19:10:49 +02:00
Prepare Dark Theme
Observe user interface theme change. https://github.com/vector-im/riot-meta/issues/22
This commit is contained in:
@@ -78,7 +78,11 @@ static void *RecordingContext = &RecordingContext;
|
||||
|
||||
NSTimer *updateVideoRecordingTimer;
|
||||
NSDate *videoRecordStartDate;
|
||||
|
||||
|
||||
/**
|
||||
Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
|
||||
*/
|
||||
id kRiotDesignValuesDidChangeThemeNotificationObserver;
|
||||
}
|
||||
|
||||
@property (nonatomic) UIBackgroundTaskIdentifier backgroundRecordingID;
|
||||
@@ -108,7 +112,6 @@ static void *RecordingContext = &RecordingContext;
|
||||
[super finalizeInit];
|
||||
|
||||
// Setup `MXKViewControllerHandling` properties
|
||||
self.defaultBarTintColor = kRiotNavBarTintColor;
|
||||
self.enableBarTintColorStatusChange = NO;
|
||||
self.rageShakeManager = [RageShakeManager sharedManager];
|
||||
|
||||
@@ -155,6 +158,19 @@ static void *RecordingContext = &RecordingContext;
|
||||
[self reloadUserLibraryAlbums];
|
||||
|
||||
}];
|
||||
|
||||
// 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)viewDidLayoutSubviews
|
||||
@@ -853,6 +869,12 @@ static void *RecordingContext = &RecordingContext;
|
||||
{
|
||||
[self stopAVCapture];
|
||||
|
||||
if (kRiotDesignValuesDidChangeThemeNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver];
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = nil;
|
||||
}
|
||||
|
||||
if (UIApplicationWillEnterForegroundNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:UIApplicationWillEnterForegroundNotificationObserver];
|
||||
|
||||
Reference in New Issue
Block a user