diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 082135202..c256a8b5a 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -444,8 +444,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN UINavigationController *secondNavController = self.secondaryNavigationController; if (secondNavController) { - secondNavController.navigationBar.barTintColor = kRiotPrimaryBgColor; - secondNavController.topViewController.view.backgroundColor = kRiotPrimaryBgColor; + secondNavController.navigationBar.barTintColor = RiotDesignValues.theme.backgroundColor; + secondNavController.topViewController.view.backgroundColor = RiotDesignValues.theme.backgroundColor; } // on IOS 8 iPad devices, force to display the primary and the secondary viewcontroller @@ -835,7 +835,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; UIViewController *emptyDetailsViewController = [storyboard instantiateViewControllerWithIdentifier:@"EmptyDetailsViewControllerStoryboardId"]; - emptyDetailsViewController.view.backgroundColor = kRiotPrimaryBgColor; + emptyDetailsViewController.view.backgroundColor = RiotDesignValues.theme.backgroundColor; splitViewController.viewControllers = @[mainViewController, emptyDetailsViewController]; } @@ -2825,7 +2825,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (!launchAnimationContainerView && window) { launchAnimationContainerView = [[UIView alloc] initWithFrame:window.bounds]; - launchAnimationContainerView.backgroundColor = kRiotPrimaryBgColor; + launchAnimationContainerView.backgroundColor = RiotDesignValues.theme.backgroundColor; launchAnimationContainerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [window addSubview:launchAnimationContainerView]; @@ -3531,7 +3531,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [_callStatusBarButton setTitle:buttonTitle forState:UIControlStateNormal]; [_callStatusBarButton setTitle:buttonTitle forState:UIControlStateHighlighted]; - _callStatusBarButton.titleLabel.textColor = kRiotPrimaryBgColor; + _callStatusBarButton.titleLabel.textColor = RiotDesignValues.theme.backgroundColor; if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) { @@ -3691,7 +3691,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; UIViewController *emptyDetailsViewController = [storyboard instantiateViewControllerWithIdentifier:@"EmptyDetailsViewControllerStoryboardId"]; - emptyDetailsViewController.view.backgroundColor = kRiotPrimaryBgColor; + emptyDetailsViewController.view.backgroundColor = RiotDesignValues.theme.backgroundColor; return emptyDetailsViewController; } diff --git a/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m b/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m index 39c495f7c..906932e71 100644 --- a/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m +++ b/Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m @@ -321,7 +321,7 @@ NSString *const kMXKRoomBubbleCellTapOnReceiptsContainer = @"kMXKRoomBubbleCellT if (blurred) { self.bubbleOverlayContainer.hidden = NO; - self.bubbleOverlayContainer.backgroundColor = kRiotPrimaryBgColor; + self.bubbleOverlayContainer.backgroundColor = RiotDesignValues.theme.backgroundColor; self.bubbleOverlayContainer.alpha = 0.8; self.bubbleOverlayContainer.userInteractionEnabled = YES; diff --git a/Riot/Constants/RiotDesignValues.h b/Riot/Constants/RiotDesignValues.h index 6572faa07..a2041738d 100644 --- a/Riot/Constants/RiotDesignValues.h +++ b/Riot/Constants/RiotDesignValues.h @@ -36,7 +36,6 @@ extern NSString *const kRiotDesignValuesDidChangeThemeNotification; alpha:1.0] #pragma mark - Riot Theme Colors (depends on the selected theme light or dark). -extern UIColor *kRiotPrimaryBgColor; extern UIColor *kRiotSecondaryBgColor; extern UIColor *kRiotPrimaryTextColor; extern UIColor *kRiotSecondaryTextColor; //subtitle, sending messages color. diff --git a/Riot/Constants/RiotDesignValues.m b/Riot/Constants/RiotDesignValues.m index fc5e552f3..a7c41ce1d 100644 --- a/Riot/Constants/RiotDesignValues.m +++ b/Riot/Constants/RiotDesignValues.m @@ -26,7 +26,6 @@ NSString *const kRiotDesignValuesDidChangeThemeNotification = @"kRiotDesignValuesDidChangeThemeNotification"; -UIColor *kRiotPrimaryBgColor; UIColor *kRiotSecondaryBgColor; UIColor *kRiotPrimaryTextColor; UIColor *kRiotSecondaryTextColor; @@ -148,7 +147,6 @@ UIScrollViewIndicatorStyle kRiotScrollBarStyle; // Apply theme color constants id theme = [RiotDesignValues theme]; - kRiotPrimaryBgColor = theme.backgroundColor; kRiotSecondaryBgColor = theme.headerBackgroundColor; kRiotPrimaryTextColor = theme.textPrimaryColor; kRiotSecondaryTextColor = theme.textSecondaryColor; diff --git a/Riot/Modules/Authentication/AuthenticationViewController.m b/Riot/Modules/Authentication/AuthenticationViewController.m index 4ad6865ae..b5e3b2d77 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/AuthenticationViewController.m @@ -135,8 +135,8 @@ self.view.backgroundColor = kRiotSecondaryBgColor; - self.authenticationScrollView.backgroundColor = kRiotPrimaryBgColor; - self.authFallbackContentView.backgroundColor = kRiotPrimaryBgColor; + self.authenticationScrollView.backgroundColor = RiotDesignValues.theme.backgroundColor; + self.authFallbackContentView.backgroundColor = RiotDesignValues.theme.backgroundColor; if (kRiotPlaceholderTextColor) { diff --git a/Riot/Modules/BugReport/BugReportViewController.m b/Riot/Modules/BugReport/BugReportViewController.m index 4055796b2..809b9d0c4 100644 --- a/Riot/Modules/BugReport/BugReportViewController.m +++ b/Riot/Modules/BugReport/BugReportViewController.m @@ -145,8 +145,8 @@ self.overlayView.backgroundColor = kRiotOverlayColor; self.overlayView.alpha = 1.0; - self.containerView.backgroundColor = kRiotPrimaryBgColor; - self.sendingContainer.backgroundColor = kRiotPrimaryBgColor; + self.containerView.backgroundColor = RiotDesignValues.theme.backgroundColor; + self.sendingContainer.backgroundColor = RiotDesignValues.theme.backgroundColor; self.bugReportDescriptionTextView.keyboardAppearance = RiotDesignValues.theme.keyboardAppearance; diff --git a/Riot/Modules/Call/CallViewController.m b/Riot/Modules/Call/CallViewController.m index da3a648a9..93e3ad985 100644 --- a/Riot/Modules/Call/CallViewController.m +++ b/Riot/Modules/Call/CallViewController.m @@ -111,7 +111,7 @@ self.localPreviewContainerView.layer.cornerRadius = 5; self.localPreviewContainerView.clipsToBounds = YES; - self.remotePreviewContainerView.backgroundColor = kRiotPrimaryBgColor; + self.remotePreviewContainerView.backgroundColor = RiotDesignValues.theme.backgroundColor; if (gradientMaskLayer) { @@ -121,9 +121,9 @@ // Add a gradient mask programatically at the top of the screen (background of the call information (name, status)) gradientMaskLayer = [CAGradientLayer layer]; - // Consider the grayscale components of the kRiotPrimaryBgColor. + // Consider the grayscale components of the RiotDesignValues.theme.backgroundColor. CGFloat white = 1.0; - [kRiotPrimaryBgColor getWhite:&white alpha:nil]; + [RiotDesignValues.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; @@ -284,7 +284,7 @@ // Set Riot navigation bar colors [RiotDesignValues.theme applyStyleOnNavigationBar:usersDevicesNavigationController.navigationBar]; - usersDevicesNavigationController.navigationBar.barTintColor = kRiotPrimaryBgColor; + usersDevicesNavigationController.navigationBar.barTintColor = RiotDesignValues.theme.backgroundColor; [usersDevicesNavigationController pushViewController:usersDevicesViewController animated:NO]; diff --git a/Riot/Modules/Call/Views/IncomingCallView.m b/Riot/Modules/Call/Views/IncomingCallView.m index 0c248c8a0..82d4552c6 100644 --- a/Riot/Modules/Call/Views/IncomingCallView.m +++ b/Riot/Modules/Call/Views/IncomingCallView.m @@ -57,11 +57,11 @@ static const CGFloat kButtonSize = 80.0; self = [super initWithFrame:CGRectZero]; if (self) { - self.backgroundColor = kRiotPrimaryBgColor; + self.backgroundColor = RiotDesignValues.theme.backgroundColor; self.opaque = YES; self.callerImageView = [[MXKImageView alloc] init]; - self.callerImageView.backgroundColor = kRiotPrimaryBgColor; + self.callerImageView.backgroundColor = RiotDesignValues.theme.backgroundColor; self.callerImageView.clipsToBounds = YES; self.callerImageView.mediaFolder = kMXMediaManagerAvatarThumbnailFolder; self.callerImageView.enableInMemoryCache = YES; @@ -74,14 +74,14 @@ static const CGFloat kButtonSize = 80.0; mediaManager:mediaManager]; self.callerNameLabel = [[UILabel alloc] init]; - self.callerNameLabel.backgroundColor = kRiotPrimaryBgColor; + self.callerNameLabel.backgroundColor = RiotDesignValues.theme.backgroundColor; self.callerNameLabel.textColor = kRiotPrimaryTextColor; self.callerNameLabel.font = [UIFont systemFontOfSize:24.0 weight:UIFontWeightMedium]; self.callerNameLabel.text = callerName; self.callerNameLabel.textAlignment = NSTextAlignmentCenter; self.callInfoLabel = [[UILabel alloc] init]; - self.callInfoLabel.backgroundColor = kRiotPrimaryBgColor; + self.callInfoLabel.backgroundColor = RiotDesignValues.theme.backgroundColor; self.callInfoLabel.textColor = kRiotSecondaryTextColor; self.callInfoLabel.font = [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]; self.callInfoLabel.text = callInfo; @@ -91,11 +91,11 @@ static const CGFloat kButtonSize = 80.0; self.answerButton = [[CircleButton alloc] initWithImage:[UIImage imageNamed:@"voice_call_icon"] borderColor:answerButtonBorderColor]; - self.answerButton.defaultBackgroundColor = kRiotPrimaryBgColor; + self.answerButton.defaultBackgroundColor = RiotDesignValues.theme.backgroundColor; [self.answerButton addTarget:self action:@selector(didTapAnswerButton) forControlEvents:UIControlEventTouchUpInside]; self.answerTitleLabel = [[UILabel alloc] init]; - self.answerTitleLabel.backgroundColor = kRiotPrimaryBgColor; + self.answerTitleLabel.backgroundColor = RiotDesignValues.theme.backgroundColor; self.answerTitleLabel.textColor = answerButtonBorderColor; self.answerTitleLabel.font = [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]; self.answerTitleLabel.text = NSLocalizedStringFromTable(@"accept", @"Vector", nil); @@ -104,11 +104,11 @@ static const CGFloat kButtonSize = 80.0; self.rejectButton = [[CircleButton alloc] initWithImage:[UIImage imageNamed:@"call_hangup_icon"] borderColor:rejectButtonBorderColor]; - self.rejectButton.defaultBackgroundColor = kRiotPrimaryBgColor; + self.rejectButton.defaultBackgroundColor = RiotDesignValues.theme.backgroundColor; [self.rejectButton addTarget:self action:@selector(didTapRejectButton) forControlEvents:UIControlEventTouchUpInside]; self.rejectTitleLabel = [[UILabel alloc] init]; - self.rejectTitleLabel.backgroundColor = kRiotPrimaryBgColor; + self.rejectTitleLabel.backgroundColor = RiotDesignValues.theme.backgroundColor; self.rejectTitleLabel.textColor = rejectButtonBorderColor; self.rejectTitleLabel.font = [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]; self.rejectTitleLabel.text = NSLocalizedStringFromTable(@"decline", @"Vector", nil); diff --git a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m index 687d13fde..701aa15ab 100644 --- a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m +++ b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m @@ -469,7 +469,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou if (count) { UILabel *missedNotifAndUnreadBadgeLabel = [[UILabel alloc] init]; - missedNotifAndUnreadBadgeLabel.textColor = kRiotPrimaryBgColor; + missedNotifAndUnreadBadgeLabel.textColor = RiotDesignValues.theme.backgroundColor; missedNotifAndUnreadBadgeLabel.font = [UIFont boldSystemFontOfSize:14]; if (count > 1000) { diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index ea1d651bb..e9dc36e11 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -164,9 +164,9 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Use the primary bg color for the recents table view in plain style. - self.recentsTableView.backgroundColor = kRiotPrimaryBgColor; + self.recentsTableView.backgroundColor = RiotDesignValues.theme.backgroundColor; topview.backgroundColor = kRiotSecondaryBgColor; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; [RiotDesignValues.theme applyStyleOnSearchBar:tableSearchBar]; [RiotDesignValues.theme applyStyleOnSearchBar:self.recentsSearchBar]; @@ -1185,7 +1185,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) @@ -1413,7 +1413,7 @@ if (indexPath && [recentsDataSource isDraggableCellAt:indexPath]) { UITableViewCell *cell = [self.recentsTableView cellForRowAtIndexPath:indexPath]; - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // snapshot the cell UIGraphicsBeginImageContextWithOptions(cell.bounds.size, NO, 0); diff --git a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m index 03700075c..866263c7a 100644 --- a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m +++ b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m @@ -51,7 +51,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; self.roomTitle.textColor = kRiotPrimaryTextColor; self.lastEventDescription.textColor = kRiotSecondaryTextColor; self.lastEventDate.textColor = kRiotSecondaryTextColor; - self.missedNotifAndUnreadBadgeLabel.textColor = kRiotPrimaryBgColor; + self.missedNotifAndUnreadBadgeLabel.textColor = RiotDesignValues.theme.backgroundColor; // Prepare direct room border CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(RiotDesignValues.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); diff --git a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m index 5baff1cc9..f59ddb601 100644 --- a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m +++ b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m @@ -182,7 +182,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle diff --git a/Riot/Modules/Common/WebViewController/WebViewViewController.m b/Riot/Modules/Common/WebViewController/WebViewViewController.m index 2bf189a44..1a6669803 100644 --- a/Riot/Modules/Common/WebViewController/WebViewViewController.m +++ b/Riot/Modules/Common/WebViewController/WebViewViewController.m @@ -56,7 +56,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; - webView.backgroundColor = kRiotPrimaryBgColor; + webView.backgroundColor = RiotDesignValues.theme.backgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle diff --git a/Riot/Modules/Communities/GroupsViewController.m b/Riot/Modules/Communities/GroupsViewController.m index 6529b08cd..b5b9f4642 100644 --- a/Riot/Modules/Communities/GroupsViewController.m +++ b/Riot/Modules/Communities/GroupsViewController.m @@ -121,9 +121,9 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Use the primary bg color for the recents table view in plain style. - self.groupsTableView.backgroundColor = kRiotPrimaryBgColor; + self.groupsTableView.backgroundColor = RiotDesignValues.theme.backgroundColor; topview.backgroundColor = kRiotSecondaryBgColor; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; [RiotDesignValues.theme applyStyleOnSearchBar:tableSearchBar]; [RiotDesignValues.theme applyStyleOnSearchBar:self.groupsSearchBar]; @@ -424,7 +424,7 @@ { [super tableView:tableView willDisplayCell:cell forRowAtIndexPath:indexPath]; - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Communities/Home/GroupHomeViewController.m b/Riot/Modules/Communities/Home/GroupHomeViewController.m index 4f1f511a6..3cc1a98c9 100644 --- a/Riot/Modules/Communities/Home/GroupHomeViewController.m +++ b/Riot/Modules/Communities/Home/GroupHomeViewController.m @@ -117,7 +117,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; self.mainHeaderContainer.backgroundColor = kRiotSecondaryBgColor; _groupName.textColor = kRiotPrimaryTextColor; diff --git a/Riot/Modules/Communities/Members/GroupParticipantsViewController.m b/Riot/Modules/Communities/Members/GroupParticipantsViewController.m index 31c0fe5fd..c42664234 100644 --- a/Riot/Modules/Communities/Members/GroupParticipantsViewController.m +++ b/Riot/Modules/Communities/Members/GroupParticipantsViewController.m @@ -154,12 +154,12 @@ _searchBarHeaderBorder.backgroundColor = RiotDesignValues.theme.headerBorderColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; // Update the gradient view above the screen CGFloat white = 1.0; - [kRiotPrimaryBgColor getWhite:&white alpha:nil]; + [RiotDesignValues.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; tableViewMaskLayer.colors = @[(__bridge id) transparentWhiteColor, (__bridge id) transparentWhiteColor, (__bridge id) opaqueWhiteColor]; @@ -444,9 +444,9 @@ // Add blur mask programmatically tableViewMaskLayer = [CAGradientLayer layer]; - // Consider the grayscale components of the kRiotPrimaryBgColor. + // Consider the grayscale components of the RiotDesignValues.theme.backgroundColor. CGFloat white = 1.0; - [kRiotPrimaryBgColor getWhite:&white alpha:nil]; + [RiotDesignValues.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; @@ -877,7 +877,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m index 68f2578de..ad78042b6 100644 --- a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m +++ b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m @@ -135,7 +135,7 @@ _searchBarHeaderBorder.backgroundColor = RiotDesignValues.theme.headerBorderColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -487,7 +487,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Communities/Views/GroupTableViewCell.m b/Riot/Modules/Communities/Views/GroupTableViewCell.m index 54246f7e8..538afc64d 100644 --- a/Riot/Modules/Communities/Views/GroupTableViewCell.m +++ b/Riot/Modules/Communities/Views/GroupTableViewCell.m @@ -17,6 +17,7 @@ #import "GroupTableViewCell.h" #import "RiotDesignValues.h" +#import "Riot-Swift.h" #import "MXGroup+Riot.h" @@ -46,7 +47,7 @@ if (self.missedNotifAndUnreadBadgeLabel) { - self.missedNotifAndUnreadBadgeLabel.textColor = kRiotPrimaryBgColor; + self.missedNotifAndUnreadBadgeLabel.textColor = RiotDesignValues.theme.backgroundColor; } self.groupAvatar.defaultBackgroundColor = [UIColor clearColor]; diff --git a/Riot/Modules/Contacts/ContactsTableViewController.m b/Riot/Modules/Contacts/ContactsTableViewController.m index babeafeac..00a064d85 100644 --- a/Riot/Modules/Contacts/ContactsTableViewController.m +++ b/Riot/Modules/Contacts/ContactsTableViewController.m @@ -109,7 +109,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.contactsTableView.backgroundColor; if (self.contactsTableView.dataSource) @@ -288,7 +288,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Contacts/Details/ContactDetailsViewController.m b/Riot/Modules/Contacts/Details/ContactDetailsViewController.m index 3bd61c627..0b6c3f714 100644 --- a/Riot/Modules/Contacts/Details/ContactDetailsViewController.m +++ b/Riot/Modules/Contacts/Details/ContactDetailsViewController.m @@ -240,7 +240,7 @@ self.contactStatusLabel.textColor = RiotDesignValues.theme.tintColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -779,7 +779,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/EncryptionInfo/EncryptionInfoView.m b/Riot/Modules/EncryptionInfo/EncryptionInfoView.m index b4adb1dce..2cb8b2f69 100644 --- a/Riot/Modules/EncryptionInfo/EncryptionInfoView.m +++ b/Riot/Modules/EncryptionInfo/EncryptionInfoView.m @@ -29,7 +29,7 @@ [super customizeViewRendering]; self.backgroundColor = kRiotSecondaryBgColor; - self.textView.backgroundColor = kRiotPrimaryBgColor; + self.textView.backgroundColor = RiotDesignValues.theme.backgroundColor; self.defaultTextColor = kRiotPrimaryTextColor; self.cancelButton.tintColor = RiotDesignValues.theme.tintColor; self.verifyButton.tintColor = RiotDesignValues.theme.tintColor; diff --git a/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m b/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m index ef84b2644..af15ef436 100644 --- a/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m +++ b/Riot/Modules/GlobalSearch/Files/HomeFilesSearchViewController.m @@ -76,10 +76,10 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = kRiotPrimaryBgColor; + self.noResultsLabel.textColor = RiotDesignValues.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -153,7 +153,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m b/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m index 29f8ccb5d..1b851f5d0 100644 --- a/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m +++ b/Riot/Modules/GlobalSearch/Files/Views/FilesSearchTableViewCell.m @@ -19,6 +19,7 @@ #import "FilesSearchTableViewCell.h" #import "RiotDesignValues.h" +#import "Riot-Swift.h" @implementation FilesSearchTableViewCell @synthesize delegate, mxkCellData; @@ -75,7 +76,7 @@ if (bubbleData.isAttachmentWithThumbnail) { - self.attachmentImageView.backgroundColor = kRiotPrimaryBgColor; + self.attachmentImageView.backgroundColor = RiotDesignValues.theme.backgroundColor; [self.attachmentImageView setAttachmentThumb:bubbleData.attachment]; } diff --git a/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m b/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m index db81962cf..11785ea50 100644 --- a/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m +++ b/Riot/Modules/GlobalSearch/Messages/HomeMessagesSearchViewController.m @@ -83,10 +83,10 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = kRiotPrimaryBgColor; + self.noResultsLabel.textColor = RiotDesignValues.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -196,7 +196,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m b/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m index 870913b56..950d9f664 100644 --- a/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m +++ b/Riot/Modules/GlobalSearch/Rooms/DirectoryViewController.m @@ -76,7 +76,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -157,7 +157,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Home/HomeViewController.m b/Riot/Modules/Home/HomeViewController.m index b1cfe2673..6c842f03d 100644 --- a/Riot/Modules/Home/HomeViewController.m +++ b/Riot/Modules/Home/HomeViewController.m @@ -416,7 +416,7 @@ } } - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; return cell; } diff --git a/Riot/Modules/Home/Views/RoomCollectionViewCell.m b/Riot/Modules/Home/Views/RoomCollectionViewCell.m index 0b74b465b..d8c229060 100644 --- a/Riot/Modules/Home/Views/RoomCollectionViewCell.m +++ b/Riot/Modules/Home/Views/RoomCollectionViewCell.m @@ -69,7 +69,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; self.roomTitle.textColor = kRiotPrimaryTextColor; self.roomTitle1.textColor = kRiotPrimaryTextColor; self.roomTitle2.textColor = kRiotPrimaryTextColor; - self.missedNotifAndUnreadBadgeLabel.textColor = kRiotPrimaryBgColor; + self.missedNotifAndUnreadBadgeLabel.textColor = RiotDesignValues.theme.backgroundColor; // Prepare direct room border CGColorRef directRoomBorderColor = CGColorCreateCopyWithAlpha(RiotDesignValues.theme.tintColor.CGColor, kDirectRoomBorderColorAlpha); diff --git a/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m b/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m index 585a3906c..094506bbc 100644 --- a/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m +++ b/Riot/Modules/MediaPicker/Library/MediaAlbumContentViewController.m @@ -115,7 +115,7 @@ { [RiotDesignValues.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.assetsCollectionView.backgroundColor = kRiotPrimaryBgColor; + self.assetsCollectionView.backgroundColor = RiotDesignValues.theme.backgroundColor; self.activityIndicator.backgroundColor = kRiotOverlayColor; } diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.m b/Riot/Modules/MediaPicker/MediaPickerViewController.m index eab761580..7df9fd2cd 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.m +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.m @@ -186,11 +186,11 @@ static void *RecordingContext = &RecordingContext; self.activityIndicator.backgroundColor = kRiotOverlayColor; - self.cameraVideoCaptureProgressView.progressColor = kRiotPrimaryBgColor; + self.cameraVideoCaptureProgressView.progressColor = RiotDesignValues.theme.backgroundColor; self.cameraVideoCaptureProgressView.unprogressColor = [UIColor clearColor]; - self.userAlbumsTableView.backgroundColor = kRiotPrimaryBgColor; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.userAlbumsTableView.backgroundColor = RiotDesignValues.theme.backgroundColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; } - (UIStatusBarStyle)preferredStatusBarStyle @@ -343,12 +343,12 @@ static void *RecordingContext = &RecordingContext; if (self.cameraVideoCaptureProgressView.progressColor != [UIColor lightGrayColor]) { self.cameraVideoCaptureProgressView.progressColor = [UIColor lightGrayColor]; - self.cameraVideoCaptureProgressView.unprogressColor = kRiotPrimaryBgColor; + self.cameraVideoCaptureProgressView.unprogressColor = RiotDesignValues.theme.backgroundColor; } } - else if (self.cameraVideoCaptureProgressView.progressColor != kRiotPrimaryBgColor) + else if (self.cameraVideoCaptureProgressView.progressColor != RiotDesignValues.theme.backgroundColor) { - self.cameraVideoCaptureProgressView.progressColor = kRiotPrimaryBgColor; + self.cameraVideoCaptureProgressView.progressColor = RiotDesignValues.theme.backgroundColor; self.cameraVideoCaptureProgressView.unprogressColor = [UIColor lightGrayColor]; } @@ -1765,7 +1765,7 @@ static void *RecordingContext = &RecordingContext; - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Attachements/AttachmentsViewController.m b/Riot/Modules/Room/Attachements/AttachmentsViewController.m index 242bbb21a..3b189ef60 100644 --- a/Riot/Modules/Room/Attachements/AttachmentsViewController.m +++ b/Riot/Modules/Room/Attachements/AttachmentsViewController.m @@ -61,7 +61,7 @@ { [RiotDesignValues.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; self.activityIndicator.backgroundColor = kRiotOverlayColor; self.backButton.tintColor = RiotDesignValues.theme.tintColor; diff --git a/Riot/Modules/Room/Files/RoomFilesViewController.m b/Riot/Modules/Room/Files/RoomFilesViewController.m index 7f45ba55d..b425c5ed8 100644 --- a/Riot/Modules/Room/Files/RoomFilesViewController.m +++ b/Riot/Modules/Room/Files/RoomFilesViewController.m @@ -115,7 +115,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.bubblesTableView.backgroundColor; if (self.bubblesTableView.dataSource) @@ -193,7 +193,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m index 66e946d59..4b60f87cc 100644 --- a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m +++ b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m @@ -228,7 +228,7 @@ self.roomMemberStatusLabel.textColor = RiotDesignValues.theme.tintColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -843,7 +843,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Members/RoomParticipantsViewController.m b/Riot/Modules/Room/Members/RoomParticipantsViewController.m index 2ab8a29d9..1723e95e2 100644 --- a/Riot/Modules/Room/Members/RoomParticipantsViewController.m +++ b/Riot/Modules/Room/Members/RoomParticipantsViewController.m @@ -166,12 +166,12 @@ _searchBarHeaderBorder.backgroundColor = RiotDesignValues.theme.headerBorderColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; // Update the gradient view above the screen CGFloat white = 1.0; - [kRiotPrimaryBgColor getWhite:&white alpha:nil]; + [RiotDesignValues.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; tableViewMaskLayer.colors = @[(__bridge id) transparentWhiteColor, (__bridge id) transparentWhiteColor, (__bridge id) opaqueWhiteColor]; @@ -575,9 +575,9 @@ // Add blur mask programmatically tableViewMaskLayer = [CAGradientLayer layer]; - // Consider the grayscale components of the kRiotPrimaryBgColor. + // Consider the grayscale components of the RiotDesignValues.theme.backgroundColor. CGFloat white = 1.0; - [kRiotPrimaryBgColor getWhite:&white alpha:nil]; + [RiotDesignValues.theme.backgroundColor getWhite:&white alpha:nil]; CGColorRef opaqueWhiteColor = [UIColor colorWithWhite:white alpha:1.0].CGColor; CGColorRef transparentWhiteColor = [UIColor colorWithWhite:white alpha:0].CGColor; @@ -1175,7 +1175,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m b/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m index 1ec666e22..a745f1898 100644 --- a/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m +++ b/Riot/Modules/Room/ReadReceiptsDetail/ReadReceiptsViewController.m @@ -102,10 +102,10 @@ self.overlayView.alpha = 1.0; self.titleLabel.textColor = kRiotPrimaryTextColor; - self.containerView.backgroundColor = kRiotPrimaryBgColor; + self.containerView.backgroundColor = RiotDesignValues.theme.backgroundColor; // Check the table view style to select its bg color. - self.receiptsTableView.backgroundColor = ((self.receiptsTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.receiptsTableView.backgroundColor = ((self.receiptsTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.closeButton.tintColor = RiotDesignValues.theme.tintColor; @@ -240,7 +240,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 8caf471e7..798616a1d 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -424,19 +424,19 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Prepare jump to last unread banner - self.jumpToLastUnreadBannerContainer.backgroundColor = kRiotPrimaryBgColor; + self.jumpToLastUnreadBannerContainer.backgroundColor = RiotDesignValues.theme.backgroundColor; self.jumpToLastUnreadLabel.attributedText = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"room_jump_to_first_unread", @"Vector", nil) attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), NSUnderlineColorAttributeName: kRiotPrimaryTextColor, NSForegroundColorAttributeName: kRiotPrimaryTextColor}]; self.expandedHeaderContainer.backgroundColor = kRiotSecondaryBgColor; self.previewHeaderContainer.backgroundColor = kRiotSecondaryBgColor; - missedDiscussionsBadgeLabel.textColor = kRiotPrimaryBgColor; + missedDiscussionsBadgeLabel.textColor = RiotDesignValues.theme.backgroundColor; missedDiscussionsBadgeLabel.font = [UIFont boldSystemFontOfSize:14]; missedDiscussionsBadgeLabel.backgroundColor = [UIColor clearColor]; // Check the table view style to select its bg color. - self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.bubblesTableView.backgroundColor = ((self.bubblesTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.bubblesTableView.backgroundColor; if (self.bubblesTableView.dataSource) @@ -3338,7 +3338,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m b/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m index 31949524b..bf25d0598 100644 --- a/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m +++ b/Riot/Modules/Room/Search/Files/RoomFilesSearchViewController.m @@ -77,10 +77,10 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = kRiotPrimaryBgColor; + self.noResultsLabel.textColor = RiotDesignValues.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -146,7 +146,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m b/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m index 636824993..a43bb3f94 100644 --- a/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m +++ b/Riot/Modules/Room/Search/Messages/RoomMessagesSearchViewController.m @@ -78,10 +78,10 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.searchTableView.backgroundColor = ((self.searchTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.searchTableView.backgroundColor; - self.noResultsLabel.textColor = kRiotPrimaryBgColor; + self.noResultsLabel.textColor = RiotDesignValues.theme.backgroundColor; if (self.searchTableView.dataSource) { @@ -173,7 +173,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Settings/RoomSettingsViewController.m b/Riot/Modules/Room/Settings/RoomSettingsViewController.m index abc30635f..2db8b52cb 100644 --- a/Riot/Modules/Room/Settings/RoomSettingsViewController.m +++ b/Riot/Modules/Room/Settings/RoomSettingsViewController.m @@ -271,7 +271,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -2822,7 +2822,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m b/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m index 586f572af..56af7f992 100644 --- a/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m +++ b/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m @@ -18,6 +18,7 @@ #import "RoomActivitiesView.h" #import "RiotDesignValues.h" +#import "Riot-Swift.h" #import @@ -259,12 +260,12 @@ // Display the string in white on pink red NSRange wholeString = NSMakeRange(0, onGoingConferenceCallAttibutedString.length); - [onGoingConferenceCallAttibutedString addAttribute:NSForegroundColorAttributeName value:kRiotPrimaryBgColor range:wholeString]; + [onGoingConferenceCallAttibutedString addAttribute:NSForegroundColorAttributeName value:RiotDesignValues.theme.backgroundColor range:wholeString]; [onGoingConferenceCallAttibutedString addAttribute:NSBackgroundColorAttributeName value:kRiotColorPinkRed range:wholeString]; [onGoingConferenceCallAttibutedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15] range:wholeString]; self.messageTextView.attributedText = onGoingConferenceCallAttibutedString; - self.messageTextView.tintColor = kRiotPrimaryBgColor; + self.messageTextView.tintColor = RiotDesignValues.theme.backgroundColor; self.messageTextView.hidden = NO; self.backgroundColor = kRiotColorPinkRed; @@ -431,13 +432,13 @@ message2 = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"room_resource_usage_limit_reached_message_2", @"Vector", nil) attributes:@{ NSFontAttributeName: [UIFont boldSystemFontOfSize:fontSize], - NSForegroundColorAttributeName: kRiotPrimaryBgColor + NSForegroundColorAttributeName: RiotDesignValues.theme.backgroundColor }]; } NSDictionary *attributes = @{ NSFontAttributeName: [UIFont systemFontOfSize:fontSize], - NSForegroundColorAttributeName: kRiotPrimaryBgColor + NSForegroundColorAttributeName: RiotDesignValues.theme.backgroundColor }; NSDictionary *messageContact2LinkAttributes; @@ -481,7 +482,7 @@ [attributedText appendAttributedString:messageContact3]; self.messageTextView.attributedText = attributedText; - self.messageTextView.tintColor = kRiotPrimaryBgColor; + self.messageTextView.tintColor = RiotDesignValues.theme.backgroundColor; self.messageTextView.hidden = NO; if (hardLimit) diff --git a/Riot/Modules/Room/Views/Event/EventDetailsView.m b/Riot/Modules/Room/Views/Event/EventDetailsView.m index 3b981204d..6ef3e4f27 100644 --- a/Riot/Modules/Room/Views/Event/EventDetailsView.m +++ b/Riot/Modules/Room/Views/Event/EventDetailsView.m @@ -26,7 +26,7 @@ [super customizeViewRendering]; self.backgroundColor = kRiotSecondaryBgColor; - self.textView.backgroundColor = kRiotPrimaryBgColor; + self.textView.backgroundColor = RiotDesignValues.theme.backgroundColor; self.textView.textColor = kRiotPrimaryTextColor; self.redactButton.tintColor = RiotDesignValues.theme.tintColor; self.closeButton.tintColor = RiotDesignValues.theme.tintColor; diff --git a/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m b/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m index af2e847d3..3b60c3825 100644 --- a/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m +++ b/Riot/Modules/Rooms/DirectoryPicker/DirectoryServerPickerViewController.m @@ -125,7 +125,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -226,7 +226,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Settings/Language/LanguagePickerViewController.m b/Riot/Modules/Settings/Language/LanguagePickerViewController.m index e92d41ee6..fb325864e 100644 --- a/Riot/Modules/Settings/Language/LanguagePickerViewController.m +++ b/Riot/Modules/Settings/Language/LanguagePickerViewController.m @@ -76,8 +76,8 @@ [RiotDesignValues.theme applyStyleOnSearchBar:self.searchBar]; // Use the primary bg color for the table view in plain style. - self.tableView.backgroundColor = kRiotPrimaryBgColor; - topview.backgroundColor = kRiotPrimaryBgColor; + self.tableView.backgroundColor = RiotDesignValues.theme.backgroundColor; + topview.backgroundColor = RiotDesignValues.theme.backgroundColor; if (self.tableView.dataSource) { @@ -116,7 +116,7 @@ { cell.textLabel.textColor = kRiotPrimaryTextColor; cell.detailTextLabel.textColor = kRiotSecondaryTextColor; - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m b/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m index 078b41224..430eacf0d 100644 --- a/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m +++ b/Riot/Modules/Settings/PhoneCountry/CountryPickerViewController.m @@ -79,8 +79,8 @@ [RiotDesignValues.theme applyStyleOnSearchBar:self.searchBar]; // Use the primary bg color for the table view in plain style. - self.tableView.backgroundColor = kRiotPrimaryBgColor; - topview.backgroundColor = kRiotPrimaryBgColor; + self.tableView.backgroundColor = RiotDesignValues.theme.backgroundColor; + topview.backgroundColor = RiotDesignValues.theme.backgroundColor; self.searchDisplayController.searchResultsTableView.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -120,7 +120,7 @@ { cell.textLabel.textColor = kRiotPrimaryTextColor; cell.detailTextLabel.textColor = kRiotSecondaryTextColor; - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 2177a21fa..1f466eca0 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -339,7 +339,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -2362,7 +2362,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void); - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; if (cell.selectionStyle != UITableViewCellSelectionStyleNone) { diff --git a/Riot/Modules/Settings/Views/DeviceView.m b/Riot/Modules/Settings/Views/DeviceView.m index 2726bcf63..71f5ca407 100644 --- a/Riot/Modules/Settings/Views/DeviceView.m +++ b/Riot/Modules/Settings/Views/DeviceView.m @@ -29,7 +29,7 @@ [super customizeViewRendering]; self.containerView.backgroundColor = kRiotSecondaryBgColor; - self.textView.backgroundColor = kRiotPrimaryBgColor; + self.textView.backgroundColor = RiotDesignValues.theme.backgroundColor; self.defaultTextColor = kRiotPrimaryTextColor; self.cancelButton.tintColor = RiotDesignValues.theme.tintColor; self.deleteButton.tintColor = RiotDesignValues.theme.tintColor; diff --git a/Riot/Modules/StartChat/StartChatViewController.m b/Riot/Modules/StartChat/StartChatViewController.m index 63be60b60..365f3cbf1 100644 --- a/Riot/Modules/StartChat/StartChatViewController.m +++ b/Riot/Modules/StartChat/StartChatViewController.m @@ -152,7 +152,7 @@ _searchBarHeaderBorder.backgroundColor = RiotDesignValues.theme.headerBorderColor; // Check the table view style to select its bg color. - self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.contactsTableView.backgroundColor = ((self.contactsTableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.contactsTableView.backgroundColor; if (self.contactsTableView.dataSource) @@ -381,7 +381,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Modules/TabBar/MasterTabBarController.m b/Riot/Modules/TabBar/MasterTabBarController.m index bb81aeaf9..94460d9de 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.m +++ b/Riot/Modules/TabBar/MasterTabBarController.m @@ -119,7 +119,7 @@ self.tabBar.tintColor = RiotDesignValues.theme.tintColor; self.tabBar.barTintColor = kRiotSecondaryBgColor; - self.view.backgroundColor = kRiotPrimaryBgColor; + self.view.backgroundColor = RiotDesignValues.theme.backgroundColor; [self setNeedsStatusBarAppearanceUpdate]; } @@ -786,7 +786,7 @@ { _hidden = hidden; - [self.view superview].backgroundColor = kRiotPrimaryBgColor; + [self.view superview].backgroundColor = RiotDesignValues.theme.backgroundColor; self.view.hidden = hidden; self.navigationController.navigationBar.hidden = hidden; } diff --git a/Riot/Modules/UserDevices/UsersDevicesViewController.m b/Riot/Modules/UserDevices/UsersDevicesViewController.m index 7e01d9c44..d1b05015a 100644 --- a/Riot/Modules/UserDevices/UsersDevicesViewController.m +++ b/Riot/Modules/UserDevices/UsersDevicesViewController.m @@ -87,7 +87,7 @@ self.activityIndicator.backgroundColor = kRiotOverlayColor; // Check the table view style to select its bg color. - self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? kRiotPrimaryBgColor : kRiotSecondaryBgColor); + self.tableView.backgroundColor = ((self.tableView.style == UITableViewStylePlain) ? RiotDesignValues.theme.backgroundColor : kRiotSecondaryBgColor); self.view.backgroundColor = self.tableView.backgroundColor; if (self.tableView.dataSource) @@ -178,7 +178,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; { - cell.backgroundColor = kRiotPrimaryBgColor; + cell.backgroundColor = RiotDesignValues.theme.backgroundColor; // Update the selected background view if (kRiotSelectedBgColor) diff --git a/Riot/Utils/AvatarGenerator.m b/Riot/Utils/AvatarGenerator.m index aa18ab526..67b4d5c4a 100644 --- a/Riot/Utils/AvatarGenerator.m +++ b/Riot/Utils/AvatarGenerator.m @@ -93,7 +93,7 @@ static UILabel* backgroundLabel = nil; if (!backgroundLabel) { backgroundLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - backgroundLabel.textColor = kRiotPrimaryBgColor; + backgroundLabel.textColor = RiotDesignValues.theme.backgroundColor; backgroundLabel.textAlignment = NSTextAlignmentCenter; backgroundLabel.font = [UIFont boldSystemFontOfSize:25]; } @@ -123,7 +123,7 @@ static UILabel* backgroundLabel = nil; + (UIImage *)imageFromText:(NSString*)text withBackgroundColor:(UIColor*)color size:(CGFloat)size andFontSize:(CGFloat)fontSize { UILabel *bgLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size, size)]; - bgLabel.textColor = kRiotPrimaryBgColor; + bgLabel.textColor = RiotDesignValues.theme.backgroundColor; bgLabel.textAlignment = NSTextAlignmentCenter; bgLabel.font = [UIFont boldSystemFontOfSize:fontSize];