diff options
| -rw-r--r-- | ios/MullvadVPN/ConnectionPanelView.swift | 15 | ||||
| -rw-r--r-- | ios/MullvadVPN/en.lproj/Localizable.strings | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/ios/MullvadVPN/ConnectionPanelView.swift b/ios/MullvadVPN/ConnectionPanelView.swift index 17b2ccc796..e552d6148f 100644 --- a/ios/MullvadVPN/ConnectionPanelView.swift +++ b/ios/MullvadVPN/ConnectionPanelView.swift @@ -99,6 +99,7 @@ class ConnectionPanelView: UIView { ]) updateConnectionInfoVisibility() + updateCollapseButtonAccessibilityHint() collapseButton.addTarget(self, action: #selector(toggleCollapse(_:)), for: .touchUpInside) } @@ -127,9 +128,17 @@ class ConnectionPanelView: UIView { stackView.isHidden = !showsConnectionInfo collapseButton.style = showsConnectionInfo ? .up : .down - if collapseButton.accessibilityElementIsFocused() { - let nextAccessibleElement = showsConnectionInfo ? stackView.arrangedSubviews.first : collapseButton - UIAccessibility.post(notification: .layoutChanged, argument: nextAccessibleElement) + if collapseButton.accessibilityElementIsFocused(), showsConnectionInfo { + UIAccessibility.post(notification: .layoutChanged, argument: stackView.arrangedSubviews.first) + } + updateCollapseButtonAccessibilityHint() + } + + private func updateCollapseButtonAccessibilityHint() { + if showsConnectionInfo { + collapseButton.accessibilityHint = NSLocalizedString("CONNECTION_PANEL_COLLAPSE_BUTTON_ACCESSIBILITY_HINT", comment: "") + } else { + collapseButton.accessibilityHint = NSLocalizedString("CONNECTION_PANEL_EXPAND_BUTTON_ACCESSIBILITY_HINT", comment: "") } } } diff --git a/ios/MullvadVPN/en.lproj/Localizable.strings b/ios/MullvadVPN/en.lproj/Localizable.strings index b42834aad1..858888d92a 100644 --- a/ios/MullvadVPN/en.lproj/Localizable.strings +++ b/ios/MullvadVPN/en.lproj/Localizable.strings @@ -18,6 +18,8 @@ "ACCOUNT_EXPIRY_INAPP_NOTIFICATION_BODY" = "%@ left. Buy more credit."; "CONNECTION_PANEL_RELAY_ACCESSIBILITY_LABEL" = "Connected relay"; +"CONNECTION_PANEL_COLLAPSE_BUTTON_ACCESSIBILITY_HINT" = "Double tap to collapse the connection info panel."; +"CONNECTION_PANEL_EXPAND_BUTTON_ACCESSIBILITY_HINT" = "Double tap to expand the connection info panel."; "CONNECTION_PANEL_IN_ADDRESS_LABEL" = "In"; "CONNECTION_PANEL_IN_ADDRESS_ACCESSIBILITY_LABEL" = "Input IP address"; "CONNECTION_PANEL_OUT_ADDRESS_LABEL" = "Out"; |
