| 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/autofill_data_item.h" | 5 #import "ios/chrome/browser/ui/settings/cells/autofill_data_item.h" |
| 6 | 6 |
| 7 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 7 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
| 8 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 8 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) | 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." | 11 #error "This file requires ARC support." |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 // Padding used on the leading and trailing edges of the cell. | 15 // Padding used on the leading and trailing edges of the cell. |
| 16 const CGFloat kHorizontalPadding = 16; | 16 const CGFloat kHorizontalPadding = 16; |
| 17 // Padding used on the top and bottom edges of the cell. | 17 // Padding used on the top and bottom edges of the cell. |
| 18 const CGFloat kVerticalPadding = 16; | 18 const CGFloat kVerticalPadding = 16; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 _leadingDetailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; | 78 _leadingDetailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; |
| 79 [contentView addSubview:_leadingDetailTextLabel]; | 79 [contentView addSubview:_leadingDetailTextLabel]; |
| 80 | 80 |
| 81 _trailingDetailTextLabel = [[UILabel alloc] init]; | 81 _trailingDetailTextLabel = [[UILabel alloc] init]; |
| 82 _trailingDetailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; | 82 _trailingDetailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; |
| 83 [contentView addSubview:_trailingDetailTextLabel]; | 83 [contentView addSubview:_trailingDetailTextLabel]; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // Sets default font and text colors for labels. | 86 // Sets default font and text colors for labels. |
| 87 - (void)setDefaultViewStyling { | 87 - (void)setDefaultViewStyling { |
| 88 _textLabel.font = [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; | 88 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14]; |
| 89 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; | 89 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; |
| 90 _textLabel.numberOfLines = 0; | 90 _textLabel.numberOfLines = 0; |
| 91 _textLabel.lineBreakMode = NSLineBreakByWordWrapping; | 91 _textLabel.lineBreakMode = NSLineBreakByWordWrapping; |
| 92 | 92 |
| 93 _leadingDetailTextLabel.font = | 93 _leadingDetailTextLabel.font = |
| 94 [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:14]; | 94 [[MDCTypography fontLoader] regularFontOfSize:14]; |
| 95 _leadingDetailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; | 95 _leadingDetailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; |
| 96 _leadingDetailTextLabel.numberOfLines = 0; | 96 _leadingDetailTextLabel.numberOfLines = 0; |
| 97 _leadingDetailTextLabel.lineBreakMode = NSLineBreakByWordWrapping; | 97 _leadingDetailTextLabel.lineBreakMode = NSLineBreakByWordWrapping; |
| 98 | 98 |
| 99 _trailingDetailTextLabel.font = | 99 _trailingDetailTextLabel.font = |
| 100 [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:12]; | 100 [[MDCTypography fontLoader] regularFontOfSize:12]; |
| 101 _trailingDetailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; | 101 _trailingDetailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; |
| 102 } | 102 } |
| 103 | 103 |
| 104 // Sets constraints on subviews. | 104 // Sets constraints on subviews. |
| 105 - (void)setViewConstraints { | 105 - (void)setViewConstraints { |
| 106 UIView* contentView = self.contentView; | 106 UIView* contentView = self.contentView; |
| 107 | 107 |
| 108 // Set up the width constraint for the text label. It is activated here | 108 // Set up the width constraint for the text label. It is activated here |
| 109 // and updated in layoutSubviews. | 109 // and updated in layoutSubviews. |
| 110 _textLabelWidthConstraint = | 110 _textLabelWidthConstraint = |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 if (self.trailingDetailTextLabel.text) { | 173 if (self.trailingDetailTextLabel.text) { |
| 174 return [NSString stringWithFormat:@"%@, %@, %@", self.textLabel.text, | 174 return [NSString stringWithFormat:@"%@, %@, %@", self.textLabel.text, |
| 175 self.leadingDetailTextLabel.text, | 175 self.leadingDetailTextLabel.text, |
| 176 self.trailingDetailTextLabel.text]; | 176 self.trailingDetailTextLabel.text]; |
| 177 } | 177 } |
| 178 return [NSString stringWithFormat:@"%@, %@", self.textLabel.text, | 178 return [NSString stringWithFormat:@"%@, %@", self.textLabel.text, |
| 179 self.leadingDetailTextLabel.text]; | 179 self.leadingDetailTextLabel.text]; |
| 180 } | 180 } |
| 181 | 181 |
| 182 @end | 182 @end |
| OLD | NEW |