瀏覽代碼

Merge pull request #1571 from deltachat/accessibility_label_in_chat_list

add accessibility hint to chat list title
cyBerta 3 年之前
父節點
當前提交
453dab360f

+ 5 - 0
deltachat-ios/Controller/ChatListController.swift

@@ -26,6 +26,7 @@ class ChatListController: UITableViewController {
         view.addGestureRecognizer(navTapGesture)
         view.isUserInteractionEnabled = true
         view.font = UIFont.systemFont(ofSize: 17, weight: .semibold)
+        view.accessibilityTraits = .header
         return view
     }()
 
@@ -425,6 +426,7 @@ class ChatListController: UITableViewController {
 
     // MARK: updates
     private func updateTitle() {
+        titleView.accessibilityHint = String.localized("a11y_connectivity_hint")
         if RelayHelper.sharedInstance.isForwarding() {
             titleView.text = String.localized("forward_to")
             if !isArchive {
@@ -436,6 +438,9 @@ class ChatListController: UITableViewController {
            
         } else {
             titleView.text = DcUtils.getConnectivityString(dcContext: dcContext, connectedString: String.localized("pref_chats"))
+            if dcContext.getConnectivity() >= DC_CONNECTIVITY_CONNECTED {
+                titleView.accessibilityHint = "\(String.localized("connectivity_connected")): \(String.localized("a11y_connectivity_hint"))"
+            }
             navigationItem.setLeftBarButton(nil, animated: true)
         }
         titleView.sizeToFit()

+ 1 - 0
deltachat-ios/en.lproj/Localizable.strings

@@ -875,3 +875,4 @@
 "update_1_28_ios_extra_line" = "… and you can select a wallpaper at \"Settings / Background\" now :)";
 "update_1_30" = "Faster. More stable.\n\nFor 1.30 releases, we focused on speed and reliability, fixing dozens of bugs. Check our changelogs if your favorite one is fixed: https://get.delta.chat/#changelogs 🚀";
 
+"a11y_connectivity_hint" = "Double tap to view connectivity details.";

+ 1 - 0
scripts/untranslated.xml

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <!-- iOS specific untranslated strings -->
+    "a11y_connectivity_hint" = "Double tap to view connectivity details.";
 </resources>