Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glitchy room list header when scrolling #6660

Merged
merged 4 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Riot/Modules/Application/LegacyAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

@protocol Configurable;
@protocol LegacyAppDelegateDelegate;
@protocol SplitViewMasterViewControllerProtocol;
@class CallBar;
@class CallPresenter;
@class RoomNavigationParameters;
Expand Down Expand Up @@ -69,7 +70,7 @@ UINavigationControllerDelegate
/**
Application main view controller
*/
@property (nonatomic, readonly) MasterTabBarController *masterTabBarController;
@property (nonatomic, readonly) UIViewController<SplitViewMasterViewControllerProtocol>* masterTabBarController;

@property (strong, nonatomic) UIWindow *window;

Expand Down
5 changes: 4 additions & 1 deletion Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,10 @@ - (void)crossSigningSetupBannerCellDidTapCloseAction:(CrossSigningSetupBannerCel
- (void)recentsListServiceDidChangeData:(id<RecentsListServiceProtocol>)service
totalCountsChanged:(BOOL)totalCountsChanged
{
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
if (!BuildSettings.isNewAppLayoutActivated)
{
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
}
}

- (void)recentsListServiceDidChangeData:(id<RecentsListServiceProtocol>)service
Expand Down
23 changes: 17 additions & 6 deletions Riot/Modules/Common/Recents/RecentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,6 @@ - (void)viewDidLayoutSubviews

- (void)refreshRecentsTable
{
MXLogDebug(@"[RecentsViewController]: Refreshing recents table view")

if (!self.recentsUpdateEnabled)
{
isRefreshNeeded = YES;
Expand All @@ -384,7 +382,11 @@ - (void)refreshRecentsTable
isRefreshNeeded = NO;

// Refresh the tabBar icon badges
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
if (!BuildSettings.isNewAppLayoutActivated)
{
// Refresh the tabBar icon badges
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
}

// do not refresh if there is a pending recent drag and drop
if (movingCellPath)
Expand Down Expand Up @@ -1103,9 +1105,12 @@ - (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
[self refreshRecentsTable];
}

// Since we've enabled room list pagination, `refreshRecentsTable` not called in this case.
// Refresh tab bar badges separately.
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
if (!BuildSettings.isNewAppLayoutActivated)
{
// Since we've enabled room list pagination, `refreshRecentsTable` not called in this case.
// Refresh tab bar badges separately.
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
}

[self showEmptyViewIfNeeded];

Expand Down Expand Up @@ -1513,6 +1518,12 @@ - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButto

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (!self.recentsSearchBar)
{
[super scrollViewDidScroll:scrollView];
return;
}

dispatch_async(dispatch_get_main_queue(), ^{

[self refreshStickyHeadersContainersHeight];
Expand Down
14 changes: 7 additions & 7 deletions Riot/Modules/Common/Recents/Views/RecentTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,25 @@ - (void)render:(MXKCellData *)cellData
{
self.lastEventDescription.text = roomCellData.lastEventTextMessage;
}

self.unsentImageView.hidden = roomCellData.roomSummary.sentStatus == MXRoomSummarySentStatusOk;
self.lastEventDecriptionLabelTrailingConstraint.constant = self.unsentImageView.hidden ? 10 : 30;

// Notify unreads and bing
if (roomCellData.hasUnread)
{
self.missedNotifAndUnreadIndicator.hidden = NO;

if (0 < roomCellData.notificationCount)
{
self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor;

self.missedNotifAndUnreadBadgeBgView.hidden = NO;
self.missedNotifAndUnreadBadgeBgView.backgroundColor = self.missedNotifAndUnreadIndicator.backgroundColor;

self.missedNotifAndUnreadBadgeLabel.text = roomCellData.notificationCountStringValue;
[self.missedNotifAndUnreadBadgeLabel sizeToFit];

self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = self.missedNotifAndUnreadBadgeLabel.frame.size.width + 18;
}
else
Expand All @@ -120,8 +120,8 @@ - (void)render:(MXKCellData *)cellData
else
{
self.lastEventDate.textColor = ThemeService.shared.theme.textSecondaryColor;
// The room title is not bold anymore

// The room title is not bold anymore
self.roomTitle.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium];
}

Expand Down
Loading