diff --git a/Source/IconButton.swift b/Source/IconButton.swift index 1a40ef072f..a4797b5b05 100644 --- a/Source/IconButton.swift +++ b/Source/IconButton.swift @@ -71,4 +71,9 @@ class IconButton : UIControl { disabledAttributedString = disabledTitleStyle.attributedString(withText: title) titleLabel.attributedText = isEnabled ? enabledAttributedString : disabledAttributedString } + + func setAccessibility(with trait: UIAccessibilityTraits, hint: String) { + titleLabel.accessibilityTraits = trait + titleLabel.accessibilityHint = hint + } } diff --git a/Source/JSONFormBuilder.swift b/Source/JSONFormBuilder.swift index ca0cab6771..e9726dcc53 100644 --- a/Source/JSONFormBuilder.swift +++ b/Source/JSONFormBuilder.swift @@ -67,6 +67,9 @@ class JSONFormBuilder { descriptionLabel.textAlignment = .natural descriptionLabel.numberOfLines = 0 descriptionLabel.preferredMaxLayoutWidth = 200 //value doesn't seem to matter as long as it's small enough + + typeControl.tintColor = OEXStyles.shared().primaryBaseColor() + typeControl.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.white], for: UIControlState.selected) titleLabel.snp.makeConstraints { make in make.leading.equalTo(contentView.snp.leadingMargin) diff --git a/Source/ProfileBanner.swift b/Source/ProfileBanner.swift index 7ab443c439..f01ac94852 100644 --- a/Source/ProfileBanner.swift +++ b/Source/ProfileBanner.swift @@ -60,7 +60,7 @@ class ProfileBanner: UIView { addSubview(changeButton) changeButton.setIconAndTitle(icon: Icon.Camera, title: Strings.Profile.changePictureButton) - changeButton.accessibilityHint = Strings.Profile.changePictureAccessibilityHint + changeButton.setAccessibility(with: UIAccessibilityTraitButton, hint: Strings.Profile.changePictureAccessibilityHint) changeButton.snp.makeConstraints { make in make.centerY.equalTo(shortProfView) diff --git a/Source/en.lproj/Localizable.strings b/Source/en.lproj/Localizable.strings index 0c279bc33c..857468df80 100644 --- a/Source/en.lproj/Localizable.strings +++ b/Source/en.lproj/Localizable.strings @@ -593,7 +593,7 @@ /* Button title for moving to the next unit in the course */ "PREVIOUS_UNIT" = "Previous Unit"; /* A10y hint for the change picture button. */ -"PROFILE.CHANGE_PICTURE_ACCESSIBILITY_HINT" = "Upload a new profile picture."; +"PROFILE.CHANGE_PICTURE_ACCESSIBILITY_HINT" = "Double tap to change profile photo"; /* Change picture button text on edit profile screen. */ "PROFILE.CHANGE_PICTURE_BUTTON" = "Change"; /* Text for use a photo already in library for user profile photo alert */ diff --git a/Source/es-419.lproj/Localizable.strings b/Source/es-419.lproj/Localizable.strings index 89eee6bdfe..b9f4a0af25 100644 --- a/Source/es-419.lproj/Localizable.strings +++ b/Source/es-419.lproj/Localizable.strings @@ -593,7 +593,7 @@ /* Button title for moving to the next unit in the course */ "PREVIOUS_UNIT" = "Unidad anterior"; /* A10y hint for the change picture button. */ -"PROFILE.CHANGE_PICTURE_ACCESSIBILITY_HINT" = "Cargue una nueva foto de perfil"; +"PROFILE.CHANGE_PICTURE_ACCESSIBILITY_HINT" = "Double tap to change profile photo"; /* Change picture button text on edit profile screen. */ "PROFILE.CHANGE_PICTURE_BUTTON" = "Cambiar"; /* Text for use a photo already in library for user profile photo alert */