Index: ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm |
diff --git a/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm b/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm |
index 3a92984c5b9c3d7b5745b8d8644caeca35972f66..884b43fe66a1baee76fc02005cd6b239353ab132 100644 |
--- a/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm |
+++ b/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm |
@@ -17,6 +17,10 @@ |
@synthesize text = _text; |
@synthesize detailText = _detailText; |
@synthesize image = _image; |
+@synthesize textFont = _textFont; |
+@synthesize textColor = _textColor; |
+@synthesize detailTextFont = _detailTextFont; |
+@synthesize detailTextColor = _detailTextColor; |
- (instancetype)initWithType:(NSInteger)type { |
self = [super initWithType:type]; |
@@ -26,6 +30,35 @@ |
return self; |
} |
+- (UIFont*)textFont { |
+ if (!_textFont) { |
+ _textFont = [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; |
+ } |
+ return _textFont; |
+} |
+ |
+- (UIColor*)textColor { |
+ if (!_textColor) { |
+ _textColor = [[MDCPalette greyPalette] tint900]; |
+ } |
+ return _textColor; |
+} |
+ |
+- (UIFont*)detailTextFont { |
+ if (!_detailTextFont) { |
+ _detailTextFont = |
+ [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:14]; |
+ } |
+ return _detailTextFont; |
+} |
+ |
+- (UIColor*)detailTextColor { |
+ if (!_detailTextColor) { |
+ _detailTextColor = [[MDCPalette greyPalette] tint500]; |
+ } |
+ return _detailTextColor; |
+} |
+ |
#pragma mark CollectionViewItem |
- (void)configureCell:(MDCCollectionViewTextCell*)cell { |
@@ -43,13 +76,10 @@ |
} |
// Styling. |
- cell.textLabel.font = |
- [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; |
- cell.textLabel.textColor = [[MDCPalette greyPalette] tint900]; |
- |
- cell.detailTextLabel.font = |
- [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:14]; |
- cell.detailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; |
+ cell.textLabel.font = self.textFont; |
+ cell.textLabel.textColor = self.textColor; |
+ cell.detailTextLabel.font = self.detailTextFont; |
+ cell.detailTextLabel.textColor = self.detailTextColor; |
} |
@end |