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

Side by Side Diff: ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item.mm

Issue 2912863005: Use MDCTypography instead of MDFRobotoFontLoader directly. (Closed)
Patch Set: Tentative fix for ManualTextFramerTest Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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_footer_item .h" 5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item .h"
6 6
7 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" 7 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
8 #import "ios/chrome/browser/ui/util/label_link_controller.h" 8 #import "ios/chrome/browser/ui/util/label_link_controller.h"
9 #import "ios/chrome/common/string_util.h" 9 #import "ios/chrome/common/string_util.h"
10 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h" 10 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h"
11 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h" 11 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
12 12
13 #if !defined(__has_feature) || !__has_feature(objc_arc) 13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support." 14 #error "This file requires ARC support."
15 #endif 15 #endif
16 16
17 namespace { 17 namespace {
18 // Padding used on the leading and trailing edges of the cell. 18 // Padding used on the leading and trailing edges of the cell.
19 const CGFloat kDefaultHorizontalPadding = 24; 19 const CGFloat kDefaultHorizontalPadding = 24;
20 20
21 // Padding used on the leading edge for the text when the cell has an image. 21 // Padding used on the leading edge for the text when the cell has an image.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 _textLabel = [[UILabel alloc] init]; 84 _textLabel = [[UILabel alloc] init];
85 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; 85 _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
86 _textLabel.backgroundColor = [UIColor clearColor]; 86 _textLabel.backgroundColor = [UIColor clearColor];
87 [self.contentView addSubview:_textLabel]; 87 [self.contentView addSubview:_textLabel];
88 88
89 _imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; 89 _imageView = [[UIImageView alloc] initWithFrame:CGRectZero];
90 _imageView.translatesAutoresizingMaskIntoConstraints = NO; 90 _imageView.translatesAutoresizingMaskIntoConstraints = NO;
91 [self.contentView addSubview:_imageView]; 91 [self.contentView addSubview:_imageView];
92 92
93 _textLabel.font = 93 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14];
94 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14];
95 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; 94 _textLabel.textColor = [[MDCPalette greyPalette] tint900];
96 _textLabel.shadowOffset = CGSizeMake(1.f, 0.f); 95 _textLabel.shadowOffset = CGSizeMake(1.f, 0.f);
97 _textLabel.shadowColor = [UIColor whiteColor]; 96 _textLabel.shadowColor = [UIColor whiteColor];
98 _textLabel.numberOfLines = 0; 97 _textLabel.numberOfLines = 0;
99 _textLabel.lineBreakMode = NSLineBreakByWordWrapping; 98 _textLabel.lineBreakMode = NSLineBreakByWordWrapping;
100 99
101 _horizontalPadding = kDefaultHorizontalPadding; 100 _horizontalPadding = kDefaultHorizontalPadding;
102 _textLeadingAnchorConstraint = [_textLabel.leadingAnchor 101 _textLeadingAnchorConstraint = [_textLabel.leadingAnchor
103 constraintEqualToAnchor:_imageView.trailingAnchor]; 102 constraintEqualToAnchor:_imageView.trailingAnchor];
104 _imageLeadingAnchorConstraint = [_imageView.leadingAnchor 103 _imageLeadingAnchorConstraint = [_imageView.leadingAnchor
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 174 }
176 175
177 #pragma mark - Accessibility 176 #pragma mark - Accessibility
178 177
179 - (BOOL)isAccessibilityElement { 178 - (BOOL)isAccessibilityElement {
180 return NO; // Accessibility for this element is handled in 179 return NO; // Accessibility for this element is handled in
181 // LabelLinkController's TransparentLinkButton objects. 180 // LabelLinkController's TransparentLinkButton objects.
182 } 181 }
183 182
184 @end 183 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698