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

Side by Side Diff: ios/chrome/browser/ui/settings/cells/account_signin_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/settings/cells/account_signin_item.h" 5 #import "ios/chrome/browser/ui/settings/cells/account_signin_item.h"
6 6
7 #include "ios/chrome/grit/ios_chromium_strings.h" 7 #include "ios/chrome/grit/ios_chromium_strings.h"
8 #include "ios/chrome/grit/ios_strings.h" 8 #include "ios/chrome/grit/ios_strings.h"
9 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h" 9 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h"
10 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h" 10 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
11 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.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 kHorizontalPadding = 16; 19 const CGFloat kHorizontalPadding = 16;
20 20
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 _detailTextLabel = [[UILabel alloc] init]; 84 _detailTextLabel = [[UILabel alloc] init];
85 _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; 85 _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
86 [_detailTextLabel setNumberOfLines:3]; 86 [_detailTextLabel setNumberOfLines:3];
87 [contentView addSubview:_detailTextLabel]; 87 [contentView addSubview:_detailTextLabel];
88 } 88 }
89 89
90 - (void)setDefaultViewStyling { 90 - (void)setDefaultViewStyling {
91 _imageView.contentMode = UIViewContentModeCenter; 91 _imageView.contentMode = UIViewContentModeCenter;
92 _imageView.layer.masksToBounds = YES; 92 _imageView.layer.masksToBounds = YES;
93 _imageView.contentMode = UIViewContentModeScaleAspectFit; 93 _imageView.contentMode = UIViewContentModeScaleAspectFit;
94 _textLabel.font = [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; 94 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14];
95 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; 95 _textLabel.textColor = [[MDCPalette greyPalette] tint900];
96 _detailTextLabel.font = 96 _detailTextLabel.font = [[MDCTypography fontLoader] regularFontOfSize:14];
97 [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:14];
98 _detailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; 97 _detailTextLabel.textColor = [[MDCPalette greyPalette] tint500];
99 } 98 }
100 99
101 - (void)setViewConstraints { 100 - (void)setViewConstraints {
102 UIView* contentView = self.contentView; 101 UIView* contentView = self.contentView;
103 102
104 // This view is used to center the two leading textLabels. 103 // This view is used to center the two leading textLabels.
105 UIView* verticalCenteringView = [[UIView alloc] init]; 104 UIView* verticalCenteringView = [[UIView alloc] init];
106 verticalCenteringView.translatesAutoresizingMaskIntoConstraints = NO; 105 verticalCenteringView.translatesAutoresizingMaskIntoConstraints = NO;
107 [contentView addSubview:verticalCenteringView]; 106 [contentView addSubview:verticalCenteringView];
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 - (NSString*)accessibilityLabel { 165 - (NSString*)accessibilityLabel {
167 return l10n_util::GetNSString(IDS_IOS_SIGN_IN_TO_CHROME_SETTING_TITLE); 166 return l10n_util::GetNSString(IDS_IOS_SIGN_IN_TO_CHROME_SETTING_TITLE);
168 } 167 }
169 168
170 - (NSString*)accessibilityValue { 169 - (NSString*)accessibilityValue {
171 return [NSString stringWithFormat:@"%@, %@", self.textLabel.text, 170 return [NSString stringWithFormat:@"%@, %@", self.textLabel.text,
172 self.detailTextLabel.text]; 171 self.detailTextLabel.text];
173 } 172 }
174 173
175 @end 174 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/sad_tab/sad_tab_view.mm ('k') | ios/chrome/browser/ui/settings/cells/autofill_data_item.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698