Procházet zdrojové kódy

rename parameter to showSeparator

cyberta před 4 roky
rodič
revize
69fe3f6ece

+ 4 - 4
deltachat-ios/Chat/ChatViewController.swift

@@ -573,9 +573,9 @@ class ChatViewController: UITableViewController {
             showName = true
         }
 
-        var showFreshMessageIndicator = false
-        if let freshMessages = self.freshMessageIndex, freshMessages.row == indexPath.row {
-            showFreshMessageIndicator = true
+        var showFreshMessageSeparator = false
+        if let firstFreshMessage = self.freshMessageIndex, firstFreshMessage.row == indexPath.row {
+            showFreshMessageSeparator = true
         }
 
         cell.baseDelegate = self
@@ -583,7 +583,7 @@ class ChatViewController: UITableViewController {
                     messageStyle: configureMessageStyle(for: message, at: indexPath),
                     showAvatar: showAvatar,
                     showName: showName,
-                    showFreshMessageSeparator: showFreshMessageIndicator)
+                    showSeparator: showFreshMessageSeparator)
 
         return cell
     }

+ 2 - 2
deltachat-ios/Chat/Views/Cells/AudioMessageCell.swift

@@ -39,7 +39,7 @@ public class AudioMessageCell: BaseMessageCell {
         delegate?.playButtonTapped(cell: self, messageId: messageId)
     }
 
-    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showFreshMessageSeparator: Bool) {
+    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showSeparator: Bool) {
         messageId = msg.id
         if let text = msg.text {
             mainContentView.spacing = text.isEmpty ? 0 : 8
@@ -61,7 +61,7 @@ public class AudioMessageCell: BaseMessageCell {
         })
         
 
-        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showFreshMessageSeparator: showFreshMessageSeparator)
+        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showSeparator: showSeparator)
     }
 
     public override func prepareForReuse() {

+ 2 - 2
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -286,7 +286,7 @@ public class BaseMessageCell: UITableViewCell {
     }
 
     // update classes inheriting BaseMessageCell first before calling super.update(...)
-    func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showFreshMessageSeparator: Bool) {
+    func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showSeparator: Bool) {
         if msg.isFromCurrentSender {
             topLabel.text = msg.isForwarded ? String.localized("forwarded_message") : nil
             topLabel.textColor = msg.isForwarded ? DcColors.grayDateColor : DcColors.defaultTextColor
@@ -324,7 +324,7 @@ public class BaseMessageCell: UITableViewCell {
             avatarView.isHidden = true
         }
 
-        freshMessageSeparatorHeightConstraint?.constant = showFreshMessageSeparator ? 1 : 0
+        freshMessageSeparatorHeightConstraint?.constant = showSeparator ? 1 : 0
 
         isFullMessageButtonHidden = !msg.hasHtml
 

+ 2 - 2
deltachat-ios/Chat/Views/Cells/FileTextCell.swift

@@ -29,7 +29,7 @@ class FileTextCell: BaseMessageCell {
         fileView.prepareForReuse()
     }
 
-    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showFreshMessageSeparator: Bool) {
+    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showSeparator: Bool) {
         if let text = msg.text, !text.isEmpty {
             messageLabel.text = text
             spacer?.isActive = true
@@ -39,7 +39,7 @@ class FileTextCell: BaseMessageCell {
         
         fileView.configure(message: msg)
         accessibilityLabel = "\(String.localized("document")), \(fileView.configureAccessibilityLabel())"
-        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showFreshMessageSeparator: showFreshMessageSeparator)
+        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showSeparator: showSeparator)
     }
     
 }

+ 2 - 2
deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

@@ -42,7 +42,7 @@ class ImageTextCell: BaseMessageCell {
         contentImageView.addGestureRecognizer(gestureRecognizer)
     }
 
-    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showFreshMessageSeparator: Bool) {
+    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showSeparator: Bool) {
         messageLabel.text = msg.text
         bottomCompactView = msg.text?.isEmpty ?? true
         mainContentView.spacing = msg.text?.isEmpty ?? false ? 0 : 6
@@ -91,7 +91,7 @@ class ImageTextCell: BaseMessageCell {
                 setAspectRatioFor(message: msg, with: placeholderImage, isPlaceholder: true)
             }
         }
-        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showFreshMessageSeparator: showFreshMessageSeparator)
+        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showSeparator: showSeparator)
     }
 
     @objc func onImageTapped() {

+ 2 - 2
deltachat-ios/Chat/Views/Cells/TextMessageCell.swift

@@ -11,9 +11,9 @@ class TextMessageCell: BaseMessageCell {
         messageLabel.paddingTrailing = 12
     }
 
-    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showFreshMessageSeparator: Bool) {
+    override func update(msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, showSeparator: Bool) {
         messageLabel.text = msg.text
-        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showFreshMessageSeparator: showFreshMessageSeparator)
+        super.update(msg: msg, messageStyle: messageStyle, showAvatar: showAvatar, showName: showName, showSeparator: showSeparator)
     }
 
     override func prepareForReuse() {