| OLD | NEW |
| 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 Loading... |
| 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 body2Font]; |
| 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 |
| OLD | NEW |