Procházet zdrojové kódy

show number of selected chats in title (#1623)

* show number of selected chats in title

* handle all title changes in updateTitle()
bjoern před 2 roky
rodič
revize
f61cff0d7f

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

@@ -389,6 +389,8 @@ class ChatListController: UITableViewController {
             editingBar.showUnpinning = viewModel.hasOnlyPinnedChatsSelected(in: tableView.indexPathsForSelectedRows)
             if tableView.indexPathsForSelectedRows == nil {
                 setLongTapEditing(false)
+            } else {
+                updateTitle()
             }
         }
     }
@@ -400,6 +402,7 @@ class ChatListController: UITableViewController {
         }
         if tableView.isEditing {
             editingBar.showUnpinning = viewModel.hasOnlyPinnedChatsSelected(in: tableView.indexPathsForSelectedRows)
+            updateTitle()
             return
         }
 
@@ -538,6 +541,8 @@ class ChatListController: UITableViewController {
 
     func handleMultiSelectTitle() {
         if tableView.isEditing {
+            let cnt = tableView.indexPathsForSelectedRows?.count ?? 1
+            titleView.text = String.localized(stringID: "n_selected", count: cnt)
             navigationItem.setLeftBarButton(cancelButton, animated: true)
             navigationItem.setRightBarButton(nil, animated: true)
         } else {