Expose room cells to voiceover on Home tab.

This commit is contained in:
Doug
2022-02-19 09:06:04 +00:00
committed by Doug
parent 9eb6990802
commit 20eae1d1bb
5 changed files with 61 additions and 4 deletions
@@ -52,6 +52,8 @@
[path closePath]; // arrow top side
arrowMaskLayer.path = path.CGPath;
self.editionArrowView.layer.mask = arrowMaskLayer;
self.isAccessibilityElement = YES;
}
- (void)customizeCollectionViewCellRendering
@@ -86,6 +88,8 @@
self.roomTitle1.hidden = YES;
self.roomTitle2.hidden = YES;
NSMutableString *accessibilityLabel = [self.roomTitle.text mutableCopy];
// Check whether the room display name is an alias to keep visible the HS.
if ([MXTools isMatrixRoomAlias:roomCellData.roomDisplayname])
{
@@ -97,6 +101,7 @@
self.roomTitle1.text = [roomCellData.roomDisplayname substringToIndex:range.location + 1];
self.roomTitle2.hidden = NO;
self.roomTitle2.text = [roomCellData.roomDisplayname substringFromIndex:range.location + 1];
accessibilityLabel = [[NSString stringWithFormat:@"%@, %@", self.roomTitle1.text, self.roomTitle2.text] mutableCopy];
}
}
@@ -118,6 +123,10 @@
self.badgeLabel.hidden = NO;
self.badgeLabel.badgeColor = roomCellData.highlightCount ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor;
self.badgeLabel.text = roomCellData.notificationCountStringValue;
NSUInteger count = roomCellData.notificationCount;
NSString *newMessagesLabel = count == 1 ? [VectorL10n roomNewMessageNotification:count] : [VectorL10n roomNewMessagesNotification:count];
[accessibilityLabel appendFormat:@", %@", newMessagesLabel];
}
// Use bold font for the room title
@@ -130,6 +139,8 @@
}
self.accessibilityLabel = accessibilityLabel;
[self.roomAvatar vc_setRoomAvatarImageWith:roomCellData.avatarUrl
roomId:roomCellData.roomIdentifier
displayName:roomCellData.roomDisplayname