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

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

Issue 2957943002: [CRD iOS] Add the host setup instruction page (Closed)
Patch Set: Add comment 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
Index: remoting/ios/app/host_setup_header_view.mm
diff --git a/remoting/ios/app/host_setup_header_view.mm b/remoting/ios/app/host_setup_header_view.mm
new file mode 100644
index 0000000000000000000000000000000000000000..a310eb40cd906fa388ab357cbdf1a9d87c62b207
--- /dev/null
+++ b/remoting/ios/app/host_setup_header_view.mm
@@ -0,0 +1,52 @@
+// 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_setup_header_view.h"
+
+#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
+#import "remoting/ios/app/remoting_theme.h"
+
+static const CGFloat kSetupTitleInset = 22.f;
+static const CGFloat kBottomPadding = 6.f;
+
+// TODO(yuweih): i18n
+static NSString* const kSetupTitle =
+ @"Welcome to Chrome Remote Desktop.\n"
+ @"Let's get you setup.";
+
+@implementation HostSetupHeaderView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+ if (self = [super initWithFrame:frame]) {
+ [self commonInit];
+ }
+ return self;
+}
+
+- (void)commonInit {
+ self.backgroundColor = RemotingTheme.setupListBackgroundColor;
+
+ UILabel* titleLabel = [[UILabel alloc] init];
+ titleLabel.text = kSetupTitle;
+ titleLabel.font = MDCTypography.titleFont;
+ titleLabel.numberOfLines = 2;
+ titleLabel.adjustsFontSizeToFitWidth = YES;
+ titleLabel.textColor = UIColor.grayColor;
+ [self addSubview:titleLabel];
+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
+ [NSLayoutConstraint activateConstraints:@[
+ [titleLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor
+ constant:kSetupTitleInset],
+ [titleLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor
+ constant:-kSetupTitleInset],
+ [titleLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor
+ constant:-kBottomPadding],
+ ]];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698