Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SetBackgroundBrickCell.swift and SetVariableBrickCell.m #1840

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ - (void)hookUpSubViews:(NSArray *)inlineViewSubViews
self.variableComboBoxView = inlineViewSubViews[1];
self.thirdRowTextLabel = inlineViewSubViews[2];
self.valueTextField = inlineViewSubViews[3];
[self configureAccessibility];
}

- (void)configureAccessibility
{
self.firstRowTextLabel.isAccessibilityElement = YES;

self.variableComboBoxView.isAccessibilityElement = YES;
self.variableComboBoxView.accessibilityTraits = UIAccessibilityTraitButton;

self.thirdRowTextLabel.isAccessibilityElement = YES;

self.valueTextField.isAccessibilityElement = YES;
self.valueTextField.accessibilityTraits = UIAccessibilityTraitKeyboardKey;
}

- (NSString*)brickTitleForBackground:(BOOL)isBackground andInsertionScreen:(BOOL)isInsertion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class SetBackgroundBrickCell: BrickCell, BrickCellProtocol {

override init(frame: CGRect) {
super.init(frame: frame)
configureAccessibility()
}

required init?(coder: NSCoder) {
super.init(coder: coder)
configureAccessibility()
}

static func cellHeight() -> CGFloat {
Expand All @@ -41,8 +43,19 @@ class SetBackgroundBrickCell: BrickCell, BrickCellProtocol {
override func hookUpSubViews(_ inlineViewSubViews: [Any]!) {
self.textLabel = inlineViewSubViews[0] as? UILabel
self.lookComboBox = inlineViewSubViews[1] as? iOSCombobox
configureAccessibility()
}

private func configureAccessibility() {
self.lookComboBox?.isAccessibilityElement = true
self.lookComboBox?.accessibilityLabel = "Choose background"
self.lookComboBox?.accessibilityTraits = .popUpButton

self.textLabel?.isAccessibilityElement = true
self.textLabel?.accessibilityLabel = "Background selection"
}


func brickTitle(forBackground isBackground: Bool, andInsertionScreen isInsertion: Bool) -> String! {
kLocalizedSetBackground.appending("\n%@")
}
Expand Down