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

Side by Side Diff: ios/chrome/browser/ui/settings/cells/version_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/version_item.h" 5 #import "ios/chrome/browser/ui/settings/cells/version_item.h"
6 6
7 #include "ios/chrome/grit/ios_strings.h" 7 #include "ios/chrome/grit/ios_strings.h"
8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h" 8 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h"
9 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h" 9 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
10 #include "ui/base/l10n/l10n_util_mac.h" 10 #include "ui/base/l10n/l10n_util_mac.h"
11 11
12 #if !defined(__has_feature) || !__has_feature(objc_arc) 12 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support." 13 #error "This file requires ARC support."
14 #endif 14 #endif
15 15
16 @implementation VersionItem 16 @implementation VersionItem
17 17
18 @synthesize text = _text; 18 @synthesize text = _text;
19 19
(...skipping 27 matching lines...) Expand all
47 self.accessibilityHint = l10n_util::GetNSString(IDS_IOS_COPY_VERSION_HINT); 47 self.accessibilityHint = l10n_util::GetNSString(IDS_IOS_COPY_VERSION_HINT);
48 48
49 _textLabel = [[UILabel alloc] init]; 49 _textLabel = [[UILabel alloc] init];
50 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; 50 _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
51 _textLabel.backgroundColor = [UIColor clearColor]; 51 _textLabel.backgroundColor = [UIColor clearColor];
52 _textLabel.textAlignment = NSTextAlignmentCenter; 52 _textLabel.textAlignment = NSTextAlignmentCenter;
53 _textLabel.shadowOffset = CGSizeMake(1, 0); 53 _textLabel.shadowOffset = CGSizeMake(1, 0);
54 _textLabel.shadowColor = [UIColor whiteColor]; 54 _textLabel.shadowColor = [UIColor whiteColor];
55 [self addSubview:_textLabel]; 55 [self addSubview:_textLabel];
56 56
57 _textLabel.font = 57 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14];
58 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14];
59 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; 58 _textLabel.textColor = [[MDCPalette greyPalette] tint900];
60 59
61 // Set up the constraints. 60 // Set up the constraints.
62 [NSLayoutConstraint activateConstraints:@[ 61 [NSLayoutConstraint activateConstraints:@[
63 [_textLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], 62 [_textLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
64 [_textLabel.centerYAnchor constraintEqualToAnchor:self.centerYAnchor], 63 [_textLabel.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
65 ]]; 64 ]];
66 65
67 self.shouldHideSeparator = YES; 66 self.shouldHideSeparator = YES;
68 } 67 }
69 return self; 68 return self;
70 } 69 }
71 70
72 - (NSString*)accessibilityLabel { 71 - (NSString*)accessibilityLabel {
73 return self.textLabel.text; 72 return self.textLabel.text;
74 } 73 }
75 74
76 @end 75 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698