Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm

Issue 2627323003: Expose font and color of the main and secondary texts in CollectionViewTextItem (Closed)
Patch Set: Addressed comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698