OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if !defined(__has_feature) || !__has_feature(objc_arc) | 5 #if !defined(__has_feature) || !__has_feature(objc_arc) |
6 #error "This file requires ARC support." | 6 #error "This file requires ARC support." |
7 #endif | 7 #endif |
8 | 8 |
9 #import "remoting/ios/app/pin_entry_view.h" | 9 #import "remoting/ios/app/pin_entry_view.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 _pairingLabel = [[UILabel alloc] init]; | 44 _pairingLabel = [[UILabel alloc] init]; |
45 _pairingLabel.textColor = | 45 _pairingLabel.textColor = |
46 [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:0.5]; | 46 [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:0.5]; |
47 _pairingLabel.font = [UIFont systemFontOfSize:12.f]; | 47 _pairingLabel.font = [UIFont systemFontOfSize:12.f]; |
48 _pairingLabel.text = @"Remember my PIN on this device."; | 48 _pairingLabel.text = @"Remember my PIN on this device."; |
49 _pairingLabel.translatesAutoresizingMaskIntoConstraints = NO; | 49 _pairingLabel.translatesAutoresizingMaskIntoConstraints = NO; |
50 [self addSubview:_pairingLabel]; | 50 [self addSubview:_pairingLabel]; |
51 | 51 |
52 _pinButton = | 52 _pinButton = |
53 [MDCFloatingButton floatingButtonWithShape:MDCFloatingButtonShapeMini]; | 53 [MDCFloatingButton floatingButtonWithShape:MDCFloatingButtonShapeMini]; |
54 [_pinButton setImage:RemotingTheme.arrowIcon forState:UIControlStateNormal]; | 54 [_pinButton |
| 55 setImage:[RemotingTheme |
| 56 .arrowIcon imageFlippedForRightToLeftLayoutDirection] |
| 57 forState:UIControlStateNormal]; |
55 [_pinButton addTarget:self | 58 [_pinButton addTarget:self |
56 action:@selector(didTapPinEntry:) | 59 action:@selector(didTapPinEntry:) |
57 forControlEvents:UIControlEventTouchUpInside]; | 60 forControlEvents:UIControlEventTouchUpInside]; |
58 _pinButton.translatesAutoresizingMaskIntoConstraints = NO; | 61 _pinButton.translatesAutoresizingMaskIntoConstraints = NO; |
59 _pinButton.enabled = NO; | 62 _pinButton.enabled = NO; |
60 _pinButton.translatesAutoresizingMaskIntoConstraints = NO; | 63 _pinButton.translatesAutoresizingMaskIntoConstraints = NO; |
61 [self addSubview:_pinButton]; | 64 [self addSubview:_pinButton]; |
62 | 65 |
63 _pinEntry = [[UITextField alloc] init]; | 66 _pinEntry = [[UITextField alloc] init]; |
64 _pinEntry.textColor = [UIColor whiteColor]; | 67 _pinEntry.textColor = [UIColor whiteColor]; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 162 } |
160 | 163 |
161 #pragma mark - Private | 164 #pragma mark - Private |
162 | 165 |
163 - (void)didTapPinEntry:(id)sender { | 166 - (void)didTapPinEntry:(id)sender { |
164 [_delegate didProvidePin:_pinEntry.text createPairing:_pairingSwitch.isOn]; | 167 [_delegate didProvidePin:_pinEntry.text createPairing:_pairingSwitch.isOn]; |
165 [_pinEntry endEditing:YES]; | 168 [_pinEntry endEditing:YES]; |
166 } | 169 } |
167 | 170 |
168 @end | 171 @end |
OLD | NEW |