Browse Source

fix dark mode for contact cells

cyberta 5 years ago
parent
commit
12c989b5f6

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

@@ -193,7 +193,6 @@ class QrViewController: UITableViewController, QrCodeReaderDelegate {
             cell.backgroundColor = bg
             cell.nameLabel.text = name
             cell.emailLabel.text = contact.email
-            cell.darkMode = false
             if let img = contact.profileImage {
                 cell.setImage(img)
             } else {

+ 2 - 12
deltachat-ios/View/ContactCell.swift

@@ -47,7 +47,7 @@ class ContactCell: UITableViewCell {
         let label = UILabel()
         label.font = UIFont.systemFont(ofSize: 16, weight: .medium)
         label.lineBreakMode = .byTruncatingTail
-        label.textColor = UIColor(hexString: "2f3944")
+        label.textColor = DcColors.defaultTextColor
         // label.makeBorder()
         return label
 
@@ -82,19 +82,10 @@ class ContactCell: UITableViewCell {
         return view
     }()
 
-    var darkMode: Bool = false {
-        didSet {
-            if darkMode {
-                contentView.backgroundColor = UIColor.darkGray
-                nameLabel.textColor = UIColor.white
-                emailLabel.textColor = UIColor.white
-            }
-        }
-    }
-
     override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
         super.init(style: style, reuseIdentifier: reuseIdentifier)
         selectionStyle = .none
+        contentView.backgroundColor = DcColors.chatBackgroundColor
         setupSubviews()
     }
 
@@ -162,7 +153,6 @@ class ContactCell: UITableViewCell {
             let tap = UITapGestureRecognizer(target: self, action: #selector(onAvatarTapped))
             avatar.addGestureRecognizer(tap)
         }
-
     }
 
     func setVerified(isVerified: Bool) {

+ 0 - 1
deltachat-ios/View/ContactDetailHeader.swift

@@ -5,7 +5,6 @@ class ContactDetailHeader: ContactCell {
         super.init(style: .default, reuseIdentifier: nil)
         let bg = UIColor(red: 248 / 255, green: 248 / 255, blue: 255 / 255, alpha: 1.0)
         backgroundColor = bg
-        darkMode = false
         selectionStyle = .none
     }