浏览代码

reset backup image if there's a avatar image, so that half transparent avatars are shown correctly (#235)

cyberta 5 年之前
父节点
当前提交
a469ba50b6
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 1 0
      deltachat-ios/Controller/ChatListController.swift
  2. 5 0
      deltachat-ios/View/ContactCell.swift

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

@@ -150,6 +150,7 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
 
 
         cell.nameLabel.text = chat.name
         cell.nameLabel.text = chat.name
         if let img = chat.profileImage {
         if let img = chat.profileImage {
+            cell.resetBackupImage()
             cell.setImage(img)
             cell.setImage(img)
         } else {
         } else {
             cell.setBackupImage(name: chat.name, color: chat.color)
             cell.setBackupImage(name: chat.name, color: chat.color)

+ 5 - 0
deltachat-ios/View/ContactCell.swift

@@ -172,6 +172,11 @@ class ContactCell: UITableViewCell {
         }
         }
     }
     }
 
 
+    func resetBackupImage() {
+        initialsLabel.text = ""
+        setColor(UIColor.clear)
+    }
+
     func setBackupImage(name: String, color: UIColor) {
     func setBackupImage(name: String, color: UIColor) {
         let text = Utils.getInitials(inputName: name)
         let text = Utils.getInitials(inputName: name)