mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 10:02:46 +02:00
Enable Dark theme
TODO: - fix the app freeze when user changes the app theme.
This commit is contained in:
@@ -73,6 +73,23 @@
|
||||
- (void)userInterfaceThemeDidChange
|
||||
{
|
||||
self.defaultBarTintColor = kRiotSecondaryBgColor;
|
||||
self.barTitleColor = kRiotPrimaryTextColor;
|
||||
|
||||
// Check the table view style to select its bg color.
|
||||
self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor);
|
||||
self.view.backgroundColor = self.searchTableView.backgroundColor;
|
||||
|
||||
self.noResultsLabel.textColor = kRiotPrimaryBgColor;
|
||||
|
||||
if (self.searchTableView.dataSource)
|
||||
{
|
||||
[self.searchTableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
return kRiotDesignStatusBarStyle;
|
||||
}
|
||||
|
||||
- (void)destroy
|
||||
@@ -157,6 +174,29 @@
|
||||
|
||||
#pragma mark - Override UITableView delegate
|
||||
|
||||
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||
{
|
||||
cell.backgroundColor = kRiotPrimaryBgColor;
|
||||
|
||||
// Update the selected background view
|
||||
if (kRiotSelectedBgColor)
|
||||
{
|
||||
cell.selectedBackgroundView = [[UIView alloc] init];
|
||||
cell.selectedBackgroundView.backgroundColor = kRiotSelectedBgColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tableView.style == UITableViewStylePlain)
|
||||
{
|
||||
cell.selectedBackgroundView = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
cell.selectedBackgroundView.backgroundColor = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// `MXKRoomBubbleTableViewCell` cells displayed by the `RoomViewController`
|
||||
|
||||
Reference in New Issue
Block a user