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/collection_view/cells/collection_view_account_ite
m.h" | 5 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_account_ite
m.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" | 8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
| 9 #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" | 10 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" |
10 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
11 | 12 |
12 #if !defined(__has_feature) || !__has_feature(objc_arc) | 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
13 #error "This file requires ARC support." | 14 #error "This file requires ARC support." |
14 #endif | 15 #endif |
15 | 16 |
16 namespace { | 17 namespace { |
17 // Padding used on the leading and trailing edges of the cell. | 18 // Padding used on the leading and trailing edges of the cell. |
18 const CGFloat kHorizontalPadding = 16; | 19 const CGFloat kHorizontalPadding = 16; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 235 } |
235 } | 236 } |
236 | 237 |
237 #pragma mark - UICollectionReusableView | 238 #pragma mark - UICollectionReusableView |
238 | 239 |
239 - (void)prepareForReuse { | 240 - (void)prepareForReuse { |
240 [super prepareForReuse]; | 241 [super prepareForReuse]; |
241 self.imageView.image = nil; | 242 self.imageView.image = nil; |
242 self.textLabel.text = nil; | 243 self.textLabel.text = nil; |
243 self.detailTextLabel.text = nil; | 244 self.detailTextLabel.text = nil; |
| 245 self.detailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; |
244 self.errorIcon.image = nil; | 246 self.errorIcon.image = nil; |
245 self.accessoryType = MDCCollectionViewCellAccessoryNone; | 247 self.accessoryType = MDCCollectionViewCellAccessoryNone; |
246 self.userInteractionEnabled = YES; | 248 self.userInteractionEnabled = YES; |
247 self.contentView.alpha = 1; | 249 self.contentView.alpha = 1; |
248 UIImageView* accessoryImage = | 250 UIImageView* accessoryImage = |
249 base::mac::ObjCCastStrict<UIImageView>(self.accessoryView); | 251 base::mac::ObjCCastStrict<UIImageView>(self.accessoryView); |
250 accessoryImage.tintColor = | 252 accessoryImage.tintColor = |
251 [accessoryImage.tintColor colorWithAlphaComponent:1]; | 253 [accessoryImage.tintColor colorWithAlphaComponent:1]; |
252 } | 254 } |
253 | 255 |
254 #pragma mark - NSObject(Accessibility) | 256 #pragma mark - NSObject(Accessibility) |
255 | 257 |
256 - (NSString*)accessibilityLabel { | 258 - (NSString*)accessibilityLabel { |
257 return self.textLabel.text; | 259 return self.textLabel.text; |
258 } | 260 } |
259 | 261 |
260 - (NSString*)accessibilityValue { | 262 - (NSString*)accessibilityValue { |
261 return self.detailTextLabel.text; | 263 return self.detailTextLabel.text; |
262 } | 264 } |
263 | 265 |
264 @end | 266 @end |
OLD | NEW |