Commit b41a4be7 authored by Maxime Charland's avatar Maxime Charland Committed by Commit Bot

Add support for custom A11yID in TableViewIllustratedItem

Having a custom accessibilityIdentifier for the cell set through the TableViewItem enables easier egtests and better accessibility without having to set the ID in cellForRowAtIndexPath.

A use case for this is RecentTabs, which will use the same TableViewIllustratedItem for all the empty states, with different ItemTypes. Without this modification to TVIllustratedItem, RecentTabs would have to manually set the a11yID of the cell for every itemType.

Bug: 1098328
Change-Id: I341692643556a42984c843594a9be8d24b139762
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2313297
Commit-Queue: Maxime Charland <mcharland@google.com>
Reviewed-by: default avatarTommy Martino <tmartino@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791019}
parent 995cee37
...@@ -45,6 +45,9 @@ const CGFloat kButtonCornerRadius = 8.0; ...@@ -45,6 +45,9 @@ const CGFloat kButtonCornerRadius = 8.0;
[super configureCell:tableCell withStyler:styler]; [super configureCell:tableCell withStyler:styler];
TableViewIllustratedCell* cell = TableViewIllustratedCell* cell =
base::mac::ObjCCastStrict<TableViewIllustratedCell>(tableCell); base::mac::ObjCCastStrict<TableViewIllustratedCell>(tableCell);
if ([self.accessibilityIdentifier length]) {
cell.accessibilityIdentifier = self.accessibilityIdentifier;
}
[cell setSelectionStyle:UITableViewCellSelectionStyleNone]; [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
if (self.image) { if (self.image) {
cell.illustratedImageView.image = self.image; cell.illustratedImageView.image = self.image;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment