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/remoting_theme.h" | |
14 | |
15 static const CGFloat kTopPadding = 6.f; | |
16 | |
17 @implementation HostSetupFooterView | |
18 | |
19 - (instancetype)initWithFrame:(CGRect)frame { | |
20 if (self = [super initWithFrame:frame]) { | |
21 [self commonInit]; | |
22 } | |
23 return self; | |
24 } | |
25 | |
26 - (void)commonInit { | |
27 self.backgroundColor = RemotingTheme.setupListBackgroundColor; | |
28 | |
29 MDCRaisedButton* raisedButton = [[MDCRaisedButton alloc] init]; | |
30 | |
31 [raisedButton setTitle:@"Email link and instructions" | |
32 forState:UIControlStateNormal]; | |
33 [raisedButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; | |
nicholss
2017/06/27 16:36:01
whiteColor should come from RemotingTheme
Yuwei
2017/06/27 20:46:45
Done.
| |
34 [raisedButton sizeToFit]; | |
35 [raisedButton addTarget:self | |
36 action:@selector(didTapEmailInstructions:) | |
37 forControlEvents:UIControlEventTouchUpInside]; | |
38 [self addSubview:raisedButton]; | |
39 raisedButton.translatesAutoresizingMaskIntoConstraints = NO; | |
40 [NSLayoutConstraint activateConstraints:@[ | |
41 [raisedButton.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], | |
42 [raisedButton.topAnchor constraintEqualToAnchor:self.topAnchor | |
43 constant:kTopPadding], | |
44 ]]; | |
45 } | |
46 | |
47 - (void)didTapEmailInstructions:(id)button { | |
48 NSLog(@"Tapped email instructions."); | |
nicholss
2017/06/27 16:36:01
Here you can do what I did in the settings menu an
Yuwei
2017/06/27 20:46:45
Done.
| |
49 } | |
50 | |
51 @end | |
OLD | NEW |