OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 6 #error "This file requires ARC support." |
| 7 #endif |
| 8 |
| 9 #import "remoting/ios/app/host_setup_header_view.h" |
| 10 |
| 11 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 12 #import "remoting/ios/app/remoting_theme.h" |
| 13 |
| 14 static const CGFloat kSetupTitleInset = 22.f; |
| 15 static const CGFloat kBottomPadding = 6.f; |
| 16 |
| 17 // TODO(yuweih): i18n |
| 18 static NSString* const kSetupTitle = |
| 19 @"Welcome to Chrome Remote Desktop.\n" |
| 20 @"Let's get you setup."; |
| 21 |
| 22 @implementation HostSetupHeaderView |
| 23 |
| 24 - (instancetype)initWithFrame:(CGRect)frame { |
| 25 if (self = [super initWithFrame:frame]) { |
| 26 [self commonInit]; |
| 27 } |
| 28 return self; |
| 29 } |
| 30 |
| 31 - (void)commonInit { |
| 32 self.backgroundColor = RemotingTheme.setupListBackgroundColor; |
| 33 |
| 34 UILabel* titleLabel = [[UILabel alloc] init]; |
| 35 titleLabel.text = kSetupTitle; |
| 36 titleLabel.font = MDCTypography.titleFont; |
| 37 titleLabel.numberOfLines = 2; |
| 38 titleLabel.adjustsFontSizeToFitWidth = YES; |
| 39 titleLabel.textColor = RemotingTheme.setupListTextColor; |
| 40 [self addSubview:titleLabel]; |
| 41 titleLabel.translatesAutoresizingMaskIntoConstraints = NO; |
| 42 [NSLayoutConstraint activateConstraints:@[ |
| 43 [titleLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor |
| 44 constant:kSetupTitleInset], |
| 45 [titleLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor |
| 46 constant:-kSetupTitleInset], |
| 47 [titleLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor |
| 48 constant:-kBottomPadding], |
| 49 ]]; |
| 50 } |
| 51 |
| 52 @end |
OLD | NEW |