Bläddra i källkod

show selected background color with high transparency

cyberta 3 år sedan
förälder
incheckning
661b202631
1 ändrade filer med 9 tillägg och 0 borttagningar
  1. 9 0
      deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

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

@@ -273,6 +273,15 @@ public class BaseMessageCell: UITableViewCell {
         }
         }
     }
     }
 
 
+    public override func setSelected(_ selected: Bool, animated: Bool) {
+         super.setSelected(selected, animated: animated)
+         if selected {
+             selectedBackgroundView?.backgroundColor = DcColors.chatBackgroundColor.withAlphaComponent(0.25)
+         } else {
+             selectedBackgroundView?.backgroundColor = .clear
+         }
+     }
+
     // update classes inheriting BaseMessageCell first before calling super.update(...)
     // update classes inheriting BaseMessageCell first before calling super.update(...)
     func update(dcContext: DcContext, msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, searchText: String?, highlight: Bool) {
     func update(dcContext: DcContext, msg: DcMsg, messageStyle: UIRectCorner, showAvatar: Bool, showName: Bool, searchText: String?, highlight: Bool) {
         let fromContact = dcContext.getContact(id: msg.fromContactId)
         let fromContact = dcContext.getContact(id: msg.fromContactId)