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_footer_view.h" |
| 10 |
| 11 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate
rialButtons.h" |
| 12 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 13 #import "remoting/ios/app/app_delegate.h" |
| 14 #import "remoting/ios/app/remoting_theme.h" |
| 15 |
| 16 static const CGFloat kTopPadding = 6.f; |
| 17 |
| 18 @implementation HostSetupFooterView |
| 19 |
| 20 - (instancetype)initWithFrame:(CGRect)frame { |
| 21 if (self = [super initWithFrame:frame]) { |
| 22 [self commonInit]; |
| 23 } |
| 24 return self; |
| 25 } |
| 26 |
| 27 - (void)commonInit { |
| 28 self.backgroundColor = RemotingTheme.setupListBackgroundColor; |
| 29 |
| 30 MDCRaisedButton* raisedButton = [[MDCRaisedButton alloc] init]; |
| 31 |
| 32 [raisedButton setTitle:@"Email link and instructions" |
| 33 forState:UIControlStateNormal]; |
| 34 [raisedButton setTitleColor:RemotingTheme.buttonTextColor |
| 35 forState:UIControlStateNormal]; |
| 36 [raisedButton sizeToFit]; |
| 37 [raisedButton addTarget:self |
| 38 action:@selector(didTapEmailInstructions:) |
| 39 forControlEvents:UIControlEventTouchUpInside]; |
| 40 [self addSubview:raisedButton]; |
| 41 raisedButton.translatesAutoresizingMaskIntoConstraints = NO; |
| 42 [NSLayoutConstraint activateConstraints:@[ |
| 43 [raisedButton.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], |
| 44 [raisedButton.topAnchor constraintEqualToAnchor:self.topAnchor |
| 45 constant:kTopPadding], |
| 46 ]]; |
| 47 } |
| 48 |
| 49 - (void)didTapEmailInstructions:(id)button { |
| 50 [AppDelegate.instance emailSetupInstructions]; |
| 51 } |
| 52 |
| 53 @end |
OLD | NEW |