OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h
" | 5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h
" |
6 | 6 |
7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_cell.h
" | 7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_cell.h
" |
8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
9 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 9 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 #pragma mark CollectionViewItem | 66 #pragma mark CollectionViewItem |
67 | 67 |
68 - (void)configureCell:(CollectionViewTextCell*)cell { | 68 - (void)configureCell:(CollectionViewTextCell*)cell { |
69 [super configureCell:cell]; | 69 [super configureCell:cell]; |
70 cell.accessoryType = self.accessoryType; | 70 cell.accessoryType = self.accessoryType; |
71 cell.textLabel.text = self.text; | 71 cell.textLabel.text = self.text; |
72 cell.detailTextLabel.text = self.detailText; | 72 cell.detailTextLabel.text = self.detailText; |
73 cell.isAccessibilityElement = YES; | 73 cell.isAccessibilityElement = YES; |
74 if (self.detailText.length == 0) { | 74 if ([self.accessibilityLabel length] != 0) { |
75 cell.accessibilityLabel = self.text; | 75 cell.accessibilityLabel = self.accessibilityLabel; |
76 } else { | 76 } else { |
77 cell.accessibilityLabel = | 77 if (self.detailText.length == 0) { |
78 [NSString stringWithFormat:@"%@, %@", self.text, self.detailText]; | 78 cell.accessibilityLabel = self.text; |
| 79 } else { |
| 80 cell.accessibilityLabel = |
| 81 [NSString stringWithFormat:@"%@, %@", self.text, self.detailText]; |
| 82 } |
79 } | 83 } |
80 | 84 |
81 // Styling. | 85 // Styling. |
82 cell.textLabel.font = self.textFont; | 86 cell.textLabel.font = self.textFont; |
83 cell.textLabel.textColor = self.textColor; | 87 cell.textLabel.textColor = self.textColor; |
84 cell.textLabel.numberOfLines = self.numberOfTextLines; | 88 cell.textLabel.numberOfLines = self.numberOfTextLines; |
85 cell.detailTextLabel.font = self.detailTextFont; | 89 cell.detailTextLabel.font = self.detailTextFont; |
86 cell.detailTextLabel.textColor = self.detailTextColor; | 90 cell.detailTextLabel.textColor = self.detailTextColor; |
87 cell.detailTextLabel.numberOfLines = self.numberOfDetailTextLines; | 91 cell.detailTextLabel.numberOfLines = self.numberOfDetailTextLines; |
88 } | 92 } |
89 | 93 |
90 @end | 94 @end |
OLD | NEW |