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/status_item.h" | 5 #import "ios/chrome/browser/ui/autofill/cells/status_item.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" | 8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
9 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 9 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
10 #include "ios/chrome/grit/ios_theme_resources.h" | 10 #include "ios/chrome/grit/ios_theme_resources.h" |
11 #import "ios/third_party/material_components_ios/src/components/ActivityIndicato
r/src/MaterialActivityIndicator.h" | 11 #import "ios/third_party/material_components_ios/src/components/ActivityIndicato
r/src/MaterialActivityIndicator.h" |
12 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" | 12 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat
erialPalettes.h" |
13 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 13 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
14 | 14 |
15 #if !defined(__has_feature) || !__has_feature(objc_arc) | 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
16 #error "This file requires ARC support." | 16 #error "This file requires ARC support." |
17 #endif | 17 #endif |
18 | 18 |
19 namespace { | 19 namespace { |
20 // Padding used on the leading and trailing edges of the cell. | 20 // Padding used on the leading and trailing edges of the cell. |
21 const CGFloat kHorizontalPadding = 16; | 21 const CGFloat kHorizontalPadding = 16; |
22 } // namespace | 22 } // namespace |
23 | 23 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 [verticalCenteringView addSubview:_verifiedImageView]; | 81 [verticalCenteringView addSubview:_verifiedImageView]; |
82 | 82 |
83 _errorImageView = | 83 _errorImageView = |
84 [[UIImageView alloc] initWithImage:NativeImage(IDR_IOS_ERROR)]; | 84 [[UIImageView alloc] initWithImage:NativeImage(IDR_IOS_ERROR)]; |
85 _errorImageView.contentMode = UIViewContentModeScaleAspectFit; | 85 _errorImageView.contentMode = UIViewContentModeScaleAspectFit; |
86 _errorImageView.hidden = YES; | 86 _errorImageView.hidden = YES; |
87 _errorImageView.translatesAutoresizingMaskIntoConstraints = NO; | 87 _errorImageView.translatesAutoresizingMaskIntoConstraints = NO; |
88 [verticalCenteringView addSubview:_errorImageView]; | 88 [verticalCenteringView addSubview:_errorImageView]; |
89 | 89 |
90 _textLabel = [[UILabel alloc] init]; | 90 _textLabel = [[UILabel alloc] init]; |
91 _textLabel.font = | 91 _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:16]; |
92 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:16]; | |
93 _textLabel.numberOfLines = 0; | 92 _textLabel.numberOfLines = 0; |
94 _textLabel.lineBreakMode = NSLineBreakByWordWrapping; | 93 _textLabel.lineBreakMode = NSLineBreakByWordWrapping; |
95 // The label's position will be centered with Auto Layout but this ensures | 94 // The label's position will be centered with Auto Layout but this ensures |
96 // that if there are multiple lines of text they will be centered relative | 95 // that if there are multiple lines of text they will be centered relative |
97 // to each other. | 96 // to each other. |
98 _textLabel.textAlignment = NSTextAlignmentCenter; | 97 _textLabel.textAlignment = NSTextAlignmentCenter; |
99 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; | 98 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; |
100 [verticalCenteringView addSubview:_textLabel]; | 99 [verticalCenteringView addSubview:_textLabel]; |
101 | 100 |
102 const CGFloat kVerticalPadding = 16; | 101 const CGFloat kVerticalPadding = 16; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 self.textLabel.textColor = [[MDCPalette cr_redPalette] tint500]; | 186 self.textLabel.textColor = [[MDCPalette cr_redPalette] tint500]; |
188 [self.activityIndicator stopAnimating]; | 187 [self.activityIndicator stopAnimating]; |
189 self.activityIndicator.hidden = YES; | 188 self.activityIndicator.hidden = YES; |
190 self.verifiedImageView.hidden = YES; | 189 self.verifiedImageView.hidden = YES; |
191 self.errorImageView.hidden = NO; | 190 self.errorImageView.hidden = NO; |
192 break; | 191 break; |
193 } | 192 } |
194 } | 193 } |
195 | 194 |
196 @end | 195 @end |
OLD | NEW |