浏览代码

add 'connected' state in accessitbility hint of the chat list title

cyberta 3 年之前
父节点
当前提交
a17c06e3cf
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      deltachat-ios/Controller/ChatListController.swift

+ 4 - 1
deltachat-ios/Controller/ChatListController.swift

@@ -26,7 +26,6 @@ class ChatListController: UITableViewController {
         view.addGestureRecognizer(navTapGesture)
         view.isUserInteractionEnabled = true
         view.font = UIFont.systemFont(ofSize: 17, weight: .semibold)
-        view.accessibilityLabel = String.localized("a11y_connectivity_hint")
         return view
     }()
 
@@ -426,6 +425,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 {
@@ -437,6 +437,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()