Add missing accessibility ids in block list view.

pull/2/head
Matthew Chen 7 years ago
parent 8bcc19e36c
commit 41a3c95831

@ -64,14 +64,6 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
if (self.delegate.shouldHideContacts) { if (self.delegate.shouldHideContacts) {
self.tableViewController.tableView.scrollEnabled = NO; self.tableViewController.tableView.scrollEnabled = NO;
} }
// These subviews are lazy-created; ensure they exist now.
[self phoneNumberButton];
[self phoneNumberTextField];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _countryCodeButton);
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _phoneNumberTextField);
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _phoneNumberButton);
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _examplePhoneNumberLabel);
} }
- (void)viewDidLoad - (void)viewDidLoad
@ -131,6 +123,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
[_countryCodeButton addTarget:self [_countryCodeButton addTarget:self
action:@selector(showCountryCodeView:) action:@selector(showCountryCodeView:)
forControlEvents:UIControlEventTouchUpInside]; forControlEvents:UIControlEventTouchUpInside];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _countryCodeButton);
} }
return _countryCodeButton; return _countryCodeButton;
@ -157,6 +150,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
_examplePhoneNumberLabel = [UILabel new]; _examplePhoneNumberLabel = [UILabel new];
_examplePhoneNumberLabel.font = [self examplePhoneNumberFont]; _examplePhoneNumberLabel.font = [self examplePhoneNumberFont];
_examplePhoneNumberLabel.textColor = [Theme secondaryColor]; _examplePhoneNumberLabel.textColor = [Theme secondaryColor];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _examplePhoneNumberLabel);
} }
return _examplePhoneNumberLabel; return _examplePhoneNumberLabel;
@ -176,6 +170,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
[_phoneNumberTextField addTarget:self [_phoneNumberTextField addTarget:self
action:@selector(textFieldDidChange:) action:@selector(textFieldDidChange:)
forControlEvents:UIControlEventEditingChanged]; forControlEvents:UIControlEventEditingChanged];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _phoneNumberTextField);
} }
return _phoneNumberTextField; return _phoneNumberTextField;
@ -194,6 +189,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
_phoneNumberButton = button; _phoneNumberButton = button;
[button autoSetDimension:ALDimensionWidth toSize:140]; [button autoSetDimension:ALDimensionWidth toSize:140];
[button autoSetDimension:ALDimensionHeight toSize:kButtonHeight]; [button autoSetDimension:ALDimensionHeight toSize:kButtonHeight];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _phoneNumberButton);
} }
return _phoneNumberButton; return _phoneNumberButton;
} }
@ -511,6 +507,8 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
UIView *buttonRow = [strongSelf createRowWithHeight:kButtonRowHeight UIView *buttonRow = [strongSelf createRowWithHeight:kButtonRowHeight
previousRow:examplePhoneNumberRow previousRow:examplePhoneNumberRow
superview:cell.contentView]; superview:cell.contentView];
OWSLogVerbose(@"strongSelf.phoneNumberButton: %@", strongSelf.phoneNumberButton.accessibilityIdentifier);
OWSLogFlush();
[buttonRow addSubview:strongSelf.phoneNumberButton]; [buttonRow addSubview:strongSelf.phoneNumberButton];
[strongSelf.phoneNumberButton autoVCenterInSuperview]; [strongSelf.phoneNumberButton autoVCenterInSuperview];
[strongSelf.phoneNumberButton autoPinTrailingToSuperviewMargin]; [strongSelf.phoneNumberButton autoPinTrailingToSuperviewMargin];

Loading…
Cancel
Save