Bladeren bron

minor tweals for share extension contact list

cyberta 5 jaren geleden
bovenliggende
commit
1105c6d725
2 gewijzigde bestanden met toevoegingen van 11 en 10 verwijderingen
  1. 3 9
      DcShare/ChatListCell.swift
  2. 8 1
      DcShare/ChatListController.swift

+ 3 - 9
DcShare/ChatListCell.swift

@@ -15,7 +15,7 @@ class ChatListCell: UITableViewCell {
 
     let titleLabel: UILabel = {
         let label = UILabel()
-        label.font = UIFont.systemFont(ofSize: 16, weight: .bold)
+        label.font = UIFont.systemFont(ofSize: 16, weight: .medium)
         label.lineBreakMode = .byTruncatingTail
         label.textColor = DcColors.defaultTextColor
         label.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 1), for: NSLayoutConstraint.Axis.horizontal)
@@ -78,14 +78,8 @@ class ChatListCell: UITableViewCell {
     func updateCell(chatId: Int) {
         let chat = DcContext.shared.getChat(chatId: chatId)
         titleLabel.text = chat.name
-
-        if chat.visibility == DC_CHAT_VISIBILITY_PINNED {
-            backgroundColor = DcColors.deaddropBackground
-            contentView.backgroundColor = DcColors.deaddropBackground
-        } else {
-            backgroundColor = DcColors.contactCellBackgroundColor
-            contentView.backgroundColor = DcColors.contactCellBackgroundColor
-        }
+        backgroundColor = DcColors.contactCellBackgroundColor
+        contentView.backgroundColor = DcColors.contactCellBackgroundColor
 
         if let img = chat.profileImage {
             resetBackupImage()

+ 8 - 1
DcShare/ChatListController.swift

@@ -22,11 +22,18 @@ class ChatListController: UITableViewController {
         fatalError("init(coder:) has not been implemented")
     }
 
+    override func viewWillAppear(_ animated: Bool) {
+        preferredContentSize = UIScreen.main.bounds.size
+    }
+
     override func viewDidLoad() {
         super.viewDidLoad()
         chatList = dcContext.getChatlist(flags: DC_GCL_ADD_ALLDONE_HINT | DC_GCL_FOR_FORWARDING | DC_GCL_NO_SPECIALS, queryString: nil, queryId: 0)
         tableView.register(ChatListCell.self, forCellReuseIdentifier: contactCellReuseIdentifier)
-        tableView.rowHeight = 80
+        tableView.rowHeight = 64
+        tableView.tableHeaderView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 0.0, height: Double.leastNormalMagnitude))
+        tableView.tableFooterView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 0.0, height: Double.leastNormalMagnitude))
+
     }
 
     override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {