mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 10:32:46 +02:00
Dark Theme - Improvement
Add a top view in pickers (country, language) to display the right background in case of vertical bounce.
This commit is contained in:
@@ -24,6 +24,11 @@
|
||||
Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
|
||||
*/
|
||||
id kRiotDesignValuesDidChangeThemeNotificationObserver;
|
||||
|
||||
/**
|
||||
The fake top view displayed in case of vertical bounce.
|
||||
*/
|
||||
UIView *topview;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -46,6 +51,12 @@
|
||||
// Hide line separators of empty cells
|
||||
self.tableView.tableFooterView = [[UIView alloc] init];
|
||||
|
||||
// Add a top view which will be displayed in case of vertical bounce.
|
||||
CGFloat height = self.tableView.frame.size.height;
|
||||
topview = [[UIView alloc] initWithFrame:CGRectMake(0,-height,self.tableView.frame.size.width,height)];
|
||||
topview.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
[self.tableView addSubview:topview];
|
||||
|
||||
// Observe user interface theme change.
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kRiotDesignValuesDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
|
||||
@@ -63,8 +74,9 @@
|
||||
self.searchBar.barStyle = kRiotDesignSearchBarStyle;
|
||||
self.searchBar.tintColor = kRiotDesignSearchBarTintColor;
|
||||
|
||||
// Check the table view style to select its bg color.
|
||||
self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor);
|
||||
// Use the primary bg color for the table view in plain style.
|
||||
self.tableView.backgroundColor = kRiotPrimaryBgColor;
|
||||
topview.backgroundColor = kRiotPrimaryBgColor;
|
||||
|
||||
if (self.tableView.dataSource)
|
||||
{
|
||||
@@ -81,6 +93,9 @@
|
||||
{
|
||||
[super destroy];
|
||||
|
||||
[topview removeFromSuperview];
|
||||
topview = nil;
|
||||
|
||||
if (kRiotDesignValuesDidChangeThemeNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver];
|
||||
@@ -103,6 +118,8 @@
|
||||
|
||||
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||
{
|
||||
cell.textLabel.textColor = kRiotPrimaryTextColor;
|
||||
cell.detailTextLabel.textColor = kRiotSecondaryTextColor;
|
||||
cell.backgroundColor = kRiotPrimaryBgColor;
|
||||
|
||||
// Update the selected background view
|
||||
|
||||
Reference in New Issue
Block a user