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

Unified Diff: remoting/ios/app/host_collection_header_view.mm

Issue 2921413002: [CRD iOS] Finish up the host list UI (Closed)
Patch Set: Added sources to the target. Hopefully it will fix the issue Created 3 years, 6 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
« no previous file with comments | « remoting/ios/app/host_collection_header_view.h ('k') | remoting/ios/app/host_collection_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/ios/app/host_collection_header_view.mm
diff --git a/remoting/ios/app/host_collection_header_view.mm b/remoting/ios/app/host_collection_header_view.mm
new file mode 100644
index 0000000000000000000000000000000000000000..565642bde91402e81578ae5f99bdd15832a9b272
--- /dev/null
+++ b/remoting/ios/app/host_collection_header_view.mm
@@ -0,0 +1,57 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+#import "remoting/ios/app/host_collection_header_view.h"
+
+#import <UIKit/UIKit.h>
+
+#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
+
+// Applied on the left and right of the label.
+static const float kTitleMargin = 12.f;
+
+@interface HostCollectionHeaderView () {
+ @private
+ UILabel* _titleLabel;
+}
+@end
+
+@implementation HostCollectionHeaderView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ _titleLabel = [[UILabel alloc] init];
+ _titleLabel.font = [MDCTypography body2Font];
+ _titleLabel.textColor = [UIColor whiteColor];
+ _titleLabel.backgroundColor = [UIColor clearColor];
+ _titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
+ [self addSubview:_titleLabel];
+
+ [NSLayoutConstraint activateConstraints:@[
+ [[_titleLabel leadingAnchor] constraintEqualToAnchor:[self leadingAnchor]
+ constant:kTitleMargin],
+ [[_titleLabel centerYAnchor]
+ constraintEqualToAnchor:[self centerYAnchor]],
+ [[_titleLabel trailingAnchor]
+ constraintEqualToAnchor:[self trailingAnchor]
+ constant:-kTitleMargin],
+ ]];
+ }
+ return self;
+}
+
+- (NSString*)text {
+ return _titleLabel.text;
+}
+
+- (void)setText:(NSString*)text {
+ _titleLabel.text = text;
+}
+
+@end
« no previous file with comments | « remoting/ios/app/host_collection_header_view.h ('k') | remoting/ios/app/host_collection_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698