瀏覽代碼

move import-backup down and style it as disclosureIndicator

B. Petersen 5 年之前
父節點
當前提交
32d6b798d3
共有 1 個文件被更改,包括 7 次插入6 次删除
  1. 7 6
      deltachat-ios/Controller/AccountSetupController.swift

+ 7 - 6
deltachat-ios/Controller/AccountSetupController.swift

@@ -94,9 +94,10 @@ class AccountSetupController: UITableViewController {
         return cell
         return cell
     }()
     }()
 
 
-    private lazy var restoreCell: ActionCell = {
-        let cell = ActionCell(frame: .zero)
-        cell.actionTitle = String.localized("import_backup_title")
+    private lazy var restoreCell: UITableViewCell = {
+        let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
+        cell.textLabel?.text = String.localized("import_backup_title")
+        cell.accessoryType = .disclosureIndicator
         cell.accessibilityIdentifier = "restoreCell"
         cell.accessibilityIdentifier = "restoreCell"
         return cell
         return cell
     }()
     }()
@@ -242,12 +243,11 @@ class AccountSetupController: UITableViewController {
         self.dcContext = dcContext
         self.dcContext = dcContext
 
 
         self.sections.append(basicSection)
         self.sections.append(basicSection)
-        if !editView {
-            self.sections.append(restoreSection)
-        }
         self.sections.append(advancedSection)
         self.sections.append(advancedSection)
         if editView {
         if editView {
             self.sections.append(dangerSection)
             self.sections.append(dangerSection)
+        } else {
+            self.sections.append(restoreSection)
         }
         }
 
 
         super.init(style: .grouped)
         super.init(style: .grouped)
@@ -363,6 +363,7 @@ class AccountSetupController: UITableViewController {
         }
         }
 
 
         if tappedCell.accessibilityIdentifier == "restoreCell" {
         if tappedCell.accessibilityIdentifier == "restoreCell" {
+            tableView.reloadData() // otherwise the disclosureIndicator may stay selected
             restoreBackup()
             restoreBackup()
         } else if tappedCell.accessibilityIdentifier == "deleteAccountCell" {
         } else if tappedCell.accessibilityIdentifier == "deleteAccountCell" {
             deleteAccount()
             deleteAccount()