Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: remoting/client/ios/app/host_collection_view_cell.mm

Issue 2828113002: Provide HostView with data required for creating a new and session, and render for CRD iOS. (Closed)
Patch Set: fixing issue based on feedback. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/client/ios/app/host_collection_view_cell.mm
diff --git a/remoting/client/ios/app/host_collection_view_cell.mm b/remoting/client/ios/app/host_collection_view_cell.mm
index 167e6b9d7301da8ea011bef1e984ef9217b7ccac..251f1aa2e818eba776333fc3f53a0a4fd1c79e18 100644
--- a/remoting/client/ios/app/host_collection_view_cell.mm
+++ b/remoting/client/ios/app/host_collection_view_cell.mm
@@ -13,6 +13,7 @@
#import "ios/third_party/material_components_ios/src/components/ShadowElevations/src/MaterialShadowElevations.h"
#import "ios/third_party/material_components_ios/src/components/ShadowLayer/src/MaterialShadowLayer.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
+#import "remoting/client/ios/domain/host_info.h"
static const CGFloat kLinePadding = 2.f;
static const CGFloat kHostCardIconInset = 10.f;
@@ -20,8 +21,6 @@ static const CGFloat kHostCardPadding = 4.f;
static const CGFloat kHostCardIconSize = 45.f;
@interface HostCollectionViewCell () {
- NSString* _status;
- NSString* _title;
UIImageView* _imageView;
UILabel* _statusLabel;
UILabel* _titleLabel;
@@ -36,6 +35,8 @@ static const CGFloat kHostCardIconSize = 45.f;
//
@implementation HostCollectionViewCell
+@synthesize hostInfo = _hostInfo;
+
+ (Class)layerClass {
return [MDCShadowLayer class];
}
@@ -97,18 +98,17 @@ static const CGFloat kHostCardIconSize = 45.f;
#pragma mark - HostCollectionViewCell Public
-- (void)populateContentWithTitle:(NSString*)title status:(NSString*)status {
- _title = title;
- _titleLabel.text = title;
+- (void)populateContentWithHostInfo:(HostInfo*)hostInfo {
+ _hostInfo = hostInfo;
- _status = status;
- _statusLabel.text = status;
+ _titleLabel.text = _hostInfo.hostName;
+ _statusLabel.text = _hostInfo.status;
_imageView.image = [UIImage imageNamed:@"ic_desktop"];
// TODO(nicholss): These colors are incorrect for the final product.
// Need to update to the values in the mocks.
- if ([status isEqualToString:@"ONLINE"]) {
+ if ([_hostInfo.status isEqualToString:@"ONLINE"]) {
_imageView.backgroundColor = UIColor.greenColor;
} else {
_imageView.backgroundColor = UIColor.lightGrayColor;
@@ -119,8 +119,7 @@ static const CGFloat kHostCardIconSize = 45.f;
- (void)prepareForReuse {
[super prepareForReuse];
- _title = nil;
- _status = nil;
+ _hostInfo = nil;
_statusLabel.text = nil;
_titleLabel.text = nil;
}

Powered by Google App Engine
This is Rietveld 408576698