New App Layout: Added missing empty states in room list and space bottom sheet

This commit is contained in:
Gil Eluard
2022-08-19 17:12:33 +02:00
parent 1e0dfdb7d3
commit 74454d11cb
14 changed files with 355 additions and 16 deletions

View File

@@ -637,7 +637,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
}
else if (sectionType == RecentsDataSourceSectionTypeAllChats && !(shrinkedSectionsBitMask & RECENTSDATASOURCE_SECTION_ALL_CHATS))
{
count = self.allChatsRoomCellDataArray.count;
count = self.allChatsRoomCellDataArray.count ?: 1;
}
// Adjust this count according to the potential dragged cell.
@@ -1052,8 +1052,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
return cell;
}
else if ((sectionType == RecentsDataSourceSectionTypeConversation && !self.conversationCellDataArray.count)
|| (sectionType == RecentsDataSourceSectionTypePeople && !self.peopleCellDataArray.count)
|| (sectionType == RecentsDataSourceSectionTypeAllChats && !self.allChatsRoomCellDataArray.count))
|| (sectionType == RecentsDataSourceSectionTypePeople && !self.peopleCellDataArray.count))
{
MXKTableViewCell *tableViewCell = [tableView dequeueReusableCellWithIdentifier:[MXKTableViewCell defaultReuseIdentifier]];
if (!tableViewCell)
@@ -1080,6 +1079,15 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
return tableViewCell;
}
else if (sectionType == RecentsDataSourceSectionTypeAllChats && !self.allChatsRoomCellDataArray.count) {
RecentEmptySectionTableViewCell *tableViewCell = [tableView dequeueReusableCellWithIdentifier:[RecentEmptySectionTableViewCell defaultReuseIdentifier]];
tableViewCell.iconView.image = self.searchPatternsList ? [UIImage systemImageNamed:@"magnifyingglass"] : AssetImages.allChatsEmptyListPlaceholderIcon.image;
tableViewCell.titleLabel.text = VectorL10n.allChatsEmptyListPlaceholderTitle;
tableViewCell.messageLabel.text = self.searchPatternsList ? VectorL10n.searchNoResult : VectorL10n.allChatsEmptyUnreadsPlaceholderMessage;
return tableViewCell;
}
return [super tableView:tableView cellForRowAtIndexPath:indexPath];
}
@@ -1184,10 +1192,13 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
return self.droppingCellBackGroundView.frame.size.height;
}
if ((sectionType == RecentsDataSourceSectionTypeConversation && !self.conversationCellDataArray.count)
|| (sectionType == RecentsDataSourceSectionTypePeople && !self.peopleCellDataArray.count))
|| (sectionType == RecentsDataSourceSectionTypePeople && !self.peopleCellDataArray.count))
{
return 50.0;
}
if (sectionType == RecentsDataSourceSectionTypeAllChats && !self.allChatsRoomCellDataArray.count) {
return 300.0;
}
// Override this method here to use our own cellDataAtIndexPath
id<MXKRecentCellDataStoring> cellData = [self cellDataAtIndexPath:indexPath];