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

Unified Diff: ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm

Issue 2768933005: Use CollectionViewTextItem instead of a cast (Closed)
Patch Set: Remove MDFRoboto Created 3 years, 9 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
Index: ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
index ad7ddf797d7f8dfb60de06ec8967cdf25a331c62..2a106e11b72eafcb5a875ca531b3dcac91d63ef3 100644
--- a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
@@ -39,7 +39,7 @@
#import "ios/public/provider/chrome/browser/signin/signin_resources_provider.h"
#import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
-#import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h"
+#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
namespace {
@@ -111,6 +111,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
CollectionViewTextItem* textHeader = [
[[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease];
textHeader.text = @"MDCCollectionViewTextCell";
+ textHeader.textFont = [MDCTypography body2Font];
+ textHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:textHeader
forSectionWithIdentifier:SectionIdentifierTextCell];
@@ -329,25 +331,6 @@ const CGFloat kHorizontalImageFixedSize = 40;
self.styler.cellStyle = MDCCollectionViewCellStyleCard;
}
-#pragma mark UICollectionViewDataSource
-
-- (UICollectionReusableView*)collectionView:(UICollectionView*)collectionView
- viewForSupplementaryElementOfKind:(NSString*)kind
- atIndexPath:(NSIndexPath*)indexPath {
- UICollectionReusableView* cell = [super collectionView:collectionView
- viewForSupplementaryElementOfKind:kind
- atIndexPath:indexPath];
- MDCCollectionViewTextCell* textCell =
- base::mac::ObjCCast<MDCCollectionViewTextCell>(cell);
- if (textCell) {
- textCell.textLabel.font =
- [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14];
- textCell.textLabel.textColor = [[MDCPalette greyPalette] tint500];
- }
-
- return cell;
-};
-
#pragma mark MDCCollectionViewStylingDelegate
- (CGFloat)collectionView:(nonnull UICollectionView*)collectionView

Powered by Google App Engine
This is Rietveld 408576698