mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Modular integrations Manager: Improve dark theme management
This commit is contained in:
@@ -36,9 +36,6 @@ NSString *const kJavascriptSendResponseToModular = @"riotIOS.sendResponse('%@',
|
||||
NSString *scalarToken;
|
||||
|
||||
MXHTTPOperation *operation;
|
||||
|
||||
// Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
|
||||
id kRiotDesignValuesDidChangeThemeNotificationObserver;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -64,12 +61,6 @@ NSString *const kJavascriptSendResponseToModular = @"riotIOS.sendResponse('%@',
|
||||
|
||||
[operation cancel];
|
||||
operation = nil;
|
||||
|
||||
if (kRiotDesignValuesDidChangeThemeNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver];
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
@@ -79,24 +70,10 @@ NSString *const kJavascriptSendResponseToModular = @"riotIOS.sendResponse('%@',
|
||||
webView.scalesPageToFit = NO;
|
||||
webView.scrollView.bounces = NO;
|
||||
|
||||
webView.delegate = self;
|
||||
|
||||
// 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.view.backgroundColor = kRiotPrimaryBgColor;
|
||||
webView.backgroundColor = kRiotPrimaryBgColor;
|
||||
// Disable opacity so that the webview background uses the current interface theme
|
||||
webView.opaque = NO;
|
||||
|
||||
self.activityIndicator.backgroundColor = kRiotOverlayColor;
|
||||
|
||||
webView.delegate = self;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
|
||||
Reference in New Issue
Block a user