Browse Source

in order to avoid weird reload animations we're now using an empty background selection view. The selection state in multi-select will be visibly by the checkmark anyways

cyberta 4 năm trước cách đây
mục cha
commit
9db2a876e2

+ 2 - 8
deltachat-ios/Chat/ChatViewController.swift

@@ -488,7 +488,6 @@ class ChatViewController: UITableViewController {
                     isAvatarVisible: configureAvatarVisibility(for: message, at: indexPath),
                     isGroup: isGroupChat)
 
-        cell.selectionStyle = tableView.isEditing ? .default : .none
         return cell
     }
 
@@ -1245,13 +1244,8 @@ class ChatViewController: UITableViewController {
         self.tableView.setEditing(isEditing, animated: true)
         self.draft.isEditing = isEditing
         self.configureDraftArea(draft: self.draft)
-        UIView.performWithoutAnimation {
-            if let indexPaths = self.tableView.indexPathsForVisibleRows {
-                self.tableView.reloadRows(at: indexPaths, with: .none)
-            }
-            if let indexPath = selectedAtIndexPath {
-                _ = handleSelection(indexPath: indexPath)
-            }
+        if let indexPath = selectedAtIndexPath {
+            _ = handleSelection(indexPath: indexPath)
         }
     }
 }

+ 1 - 0
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -146,6 +146,7 @@ public class BaseMessageCell: UITableViewCell {
 
 
     func setupSubviews() {
+        selectedBackgroundView = UIView()
         contentView.addSubview(messageBackgroundContainer)
         messageBackgroundContainer.addSubview(mainContentView)
         messageBackgroundContainer.addSubview(topLabel)