OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #if !defined(__has_feature) || !__has_feature(objc_arc) | 5 #if !defined(__has_feature) || !__has_feature(objc_arc) |
6 #error "This file requires ARC support." | 6 #error "This file requires ARC support." |
7 #endif | 7 #endif |
8 | 8 |
9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 self.backgroundColor = [UIColor clearColor]; | 42 self.backgroundColor = [UIColor clearColor]; |
43 [self commonInit]; | 43 [self commonInit]; |
44 } | 44 } |
45 return self; | 45 return self; |
46 } | 46 } |
47 | 47 |
48 - (void)commonInit { | 48 - (void)commonInit { |
49 _imageView = [[UIImageView alloc] init]; | 49 _imageView = [[UIImageView alloc] init]; |
50 _imageView.translatesAutoresizingMaskIntoConstraints = NO; | 50 _imageView.translatesAutoresizingMaskIntoConstraints = NO; |
51 _imageView.contentMode = UIViewContentModeCenter; | 51 _imageView.contentMode = UIViewContentModeCenter; |
52 _imageView.alpha = 0.87f; | |
53 _imageView.backgroundColor = RemotingTheme.offlineHostColor; | 52 _imageView.backgroundColor = RemotingTheme.offlineHostColor; |
54 _imageView.layer.cornerRadius = kHostCardIconSize / 2.f; | 53 _imageView.layer.cornerRadius = kHostCardIconSize / 2.f; |
55 _imageView.layer.masksToBounds = YES; | 54 _imageView.layer.masksToBounds = YES; |
56 [self.contentView addSubview:_imageView]; | 55 [self.contentView addSubview:_imageView]; |
57 | 56 |
58 // Holds both of the labels. | 57 // Holds both of the labels. |
59 _labelView = [[UIView alloc] init]; | 58 _labelView = [[UIView alloc] init]; |
60 _labelView.translatesAutoresizingMaskIntoConstraints = NO; | 59 _labelView.translatesAutoresizingMaskIntoConstraints = NO; |
61 [self.contentView addSubview:_labelView]; | 60 [self.contentView addSubview:_labelView]; |
62 | 61 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 #pragma mark - UICollectionReusableView | 144 #pragma mark - UICollectionReusableView |
146 | 145 |
147 - (void)prepareForReuse { | 146 - (void)prepareForReuse { |
148 [super prepareForReuse]; | 147 [super prepareForReuse]; |
149 _hostInfo = nil; | 148 _hostInfo = nil; |
150 _statusLabel.text = nil; | 149 _statusLabel.text = nil; |
151 _titleLabel.text = nil; | 150 _titleLabel.text = nil; |
152 } | 151 } |
153 | 152 |
154 @end | 153 @end |
OLD | NEW |