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/autofill/cells/autofill_edit_item.h" | 5 #import "ios/chrome/browser/ui/autofill/cells/autofill_edit_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/rtl_geometry.h" | 8 #import "ios/chrome/browser/ui/rtl_geometry.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 | 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 namespace { | 16 namespace { |
17 // Padding used on the leading and trailing edges of the cell. | 17 // Padding used on the leading and trailing edges of the cell. |
18 const CGFloat kHorizontalPadding = 16; | 18 const CGFloat kHorizontalPadding = 16; |
19 | 19 |
20 // Padding used on the top and bottom edges of the cell. | 20 // Padding used on the top and bottom edges of the cell. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 UIView* contentView = self.contentView; | 91 UIView* contentView = self.contentView; |
92 | 92 |
93 _textLabel = [[UILabel alloc] init]; | 93 _textLabel = [[UILabel alloc] init]; |
94 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; | 94 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; |
95 [contentView addSubview:_textLabel]; | 95 [contentView addSubview:_textLabel]; |
96 | 96 |
97 _textField = [[UITextField alloc] init]; | 97 _textField = [[UITextField alloc] init]; |
98 _textField.translatesAutoresizingMaskIntoConstraints = NO; | 98 _textField.translatesAutoresizingMaskIntoConstraints = NO; |
99 [contentView addSubview:_textField]; | 99 [contentView addSubview:_textField]; |
100 | 100 |
101 _textLabel.font = | 101 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14]; |
102 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:14]; | |
103 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; | 102 _textLabel.textColor = [[MDCPalette greyPalette] tint900]; |
104 | 103 |
105 _textField.font = [[MDFRobotoFontLoader sharedInstance] lightFontOfSize:16]; | 104 _textField.font = [[MDCTypography fontLoader] lightFontOfSize:16]; |
106 _textField.textColor = [[MDCPalette greyPalette] tint500]; | 105 _textField.textColor = [[MDCPalette greyPalette] tint500]; |
107 _textField.autocapitalizationType = UITextAutocapitalizationTypeWords; | 106 _textField.autocapitalizationType = UITextAutocapitalizationTypeWords; |
108 _textField.autocorrectionType = UITextAutocorrectionTypeNo; | 107 _textField.autocorrectionType = UITextAutocorrectionTypeNo; |
109 _textField.returnKeyType = UIReturnKeyDone; | 108 _textField.returnKeyType = UIReturnKeyDone; |
110 _textField.clearButtonMode = UITextFieldViewModeWhileEditing; | 109 _textField.clearButtonMode = UITextFieldViewModeWhileEditing; |
111 _textField.contentVerticalAlignment = | 110 _textField.contentVerticalAlignment = |
112 UIControlContentVerticalAlignmentCenter; | 111 UIControlContentVerticalAlignmentCenter; |
113 _textField.textAlignment = | 112 _textField.textAlignment = |
114 UseRTLLayout() ? NSTextAlignmentLeft : NSTextAlignmentRight; | 113 UseRTLLayout() ? NSTextAlignmentLeft : NSTextAlignmentRight; |
115 | 114 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 194 } |
196 | 195 |
197 #pragma mark - Accessibility | 196 #pragma mark - Accessibility |
198 | 197 |
199 - (NSString*)accessibilityLabel { | 198 - (NSString*)accessibilityLabel { |
200 return [NSString | 199 return [NSString |
201 stringWithFormat:@"%@, %@", self.textLabel.text, self.textField.text]; | 200 stringWithFormat:@"%@, %@", self.textLabel.text, self.textField.text]; |
202 } | 201 } |
203 | 202 |
204 @end | 203 @end |
OLD | NEW |