diff --git a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m index c09822c15..4f0c94dd9 100644 --- a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m +++ b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m @@ -44,6 +44,7 @@ { [super customizeTableViewCellRendering]; + self.contentView.backgroundColor = ThemeService.shared.theme.backgroundColor; self.roomTitle.textColor = ThemeService.shared.theme.textPrimaryColor; self.lastEventDescription.textColor = ThemeService.shared.theme.textSecondaryColor; self.lastEventDate.textColor = ThemeService.shared.theme.textSecondaryColor; diff --git a/Riot/Modules/Common/Recents/Views/RecentsInvitesTableViewCell.swift b/Riot/Modules/Common/Recents/Views/RecentsInvitesTableViewCell.swift index 17ff6e49c..dea15153e 100644 --- a/Riot/Modules/Common/Recents/Views/RecentsInvitesTableViewCell.swift +++ b/Riot/Modules/Common/Recents/Views/RecentsInvitesTableViewCell.swift @@ -48,6 +48,12 @@ class RecentsInvitesTableViewCell: UITableViewCell, NibReusable, Themable { update(theme: ThemeService.shared().theme) } + override func prepareForReuse() { + super.prepareForReuse() + + update(theme: ThemeService.shared().theme) + } + // MARK: - Themable func update(theme: Theme) { diff --git a/Riot/Modules/Common/Toasts/RoundedToastView.swift b/Riot/Modules/Common/Toasts/RoundedToastView.swift index 879a31167..db62ed7ca 100644 --- a/Riot/Modules/Common/Toasts/RoundedToastView.swift +++ b/Riot/Modules/Common/Toasts/RoundedToastView.swift @@ -95,6 +95,20 @@ class RoundedToastView: UIView, Themable { layer.cornerRadius = layer.frame.height / 2 } + override func willMove(toSuperview newSuperview: UIView?) { + super.willMove(toSuperview: newSuperview) + + if newSuperview != nil { + NotificationCenter.default.addObserver(self, selector: #selector(self.themeDidChange(notification:)), name: NSNotification.Name.themeServiceDidChangeTheme, object: nil) + } else { + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.themeServiceDidChangeTheme, object: nil) + } + } + + @objc private func themeDidChange(notification: Notification) { + update(theme: ThemeService.shared().theme) + } + func update(theme: Theme) { backgroundColor = theme.colors.system stackView.arrangedSubviews.first?.tintColor = theme.colors.primaryContent diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index 27901c266..d1df10be0 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -315,7 +315,8 @@ class AllChatsViewController: HomeViewController { } let sectionType = recentsDataSource.sections.sectionType(forSectionIndex: indexPath.section) - guard sectionType == .allChats, let numberOfRowsInSection = recentsDataSource.recentsListService.allChatsRoomListData?.counts.numberOfRooms, indexPath.row == numberOfRowsInSection - 1 else { + // We need to trottle a bit earlier so the next section is not visible even if the tableview scrolls faster + guard sectionType == .allChats, let numberOfRowsInSection = recentsDataSource.recentsListService.allChatsRoomListData?.counts.numberOfRooms, indexPath.row == numberOfRowsInSection - 4 else { return } diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m index c48bfda5a..b173025d6 100644 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m +++ b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m @@ -16,6 +16,8 @@ */ #import "MXKRoomInputToolbarViewWithSimpleTextView.h" +#import "ThemeService.h" +#import "GeneratedInterface-Swift.h" @implementation MXKRoomInputToolbarViewWithSimpleTextView @@ -39,7 +41,10 @@ [super customizeViewRendering]; // Set default message composer background color - self.messageComposerTextView.backgroundColor = [UIColor whiteColor]; + self.messageComposerTextView.backgroundColor = ThemeService.shared.theme.backgroundColor; + self.backgroundColor = ThemeService.shared.theme.colors.system; + self.leftInputToolbarButton.tintColor = ThemeService.shared.theme.colors.accent; + self.rightInputToolbarButton.tintColor = ThemeService.shared.theme.colors.accent; } - (NSString*)textMessage diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index bb0767c47..d7df77ead 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -351,9 +351,9 @@ static CGSize kThreadListBarButtonItemImageSize; [self setupRemoveJitsiWidgetRemoveView]; - // Replace the default input toolbar view. - // Note: this operation will force the layout of subviews. That is why cell view classes must be registered before. dispatch_async(dispatch_get_main_queue(), ^{ + // Replace the default input toolbar view. + // Note: this operation will force the layout of subviews. That is why cell view classes must be registered before. [self updateRoomInputToolbarViewClassIfNeeded]; }); diff --git a/Riot/Modules/Room/RoomViewController.xib b/Riot/Modules/Room/RoomViewController.xib index aac9ed79a..888aa3b75 100644 --- a/Riot/Modules/Room/RoomViewController.xib +++ b/Riot/Modules/Room/RoomViewController.xib @@ -150,7 +150,7 @@