Browse Source

Merge pull request #862 from deltachat/profile_bg_colors

groupDetail / chatDetail -> background colors
bjoern 5 years ago
parent
commit
950270686c

+ 5 - 0
DcCore/DcCore/Helper/DcColors.swift

@@ -1,6 +1,10 @@
 import UIKit
 
 public struct DcColors {
+    private static let white                                  = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
+    private static let actionCellBackgroundDark               = #colorLiteral(red: 0.1031623408, green: 0.1083367988, blue: 0.1185036376, alpha: 1)
+
+
     public static let primary = UIColor.systemBlue
     public static let colorDisabled = UIColor.themeColor(light: UIColor(white: 0.9, alpha: 1), dark: UIColor(white: 0.2, alpha: 1))
     public static let messagePrimaryColor = UIColor.themeColor(light: UIColor.rgb(red: 220, green: 248, blue: 198),
@@ -9,6 +13,7 @@ public struct DcColors {
                                                           dark: UIColor.init(hexString: "333333"))
     public static let contactCellBackgroundColor = UIColor.themeColor(light: .white, dark: .black)
     public static let defaultBackgroundColor = UIColor.themeColor(light: .white, dark: .black)
+    public static let sharedChatCellBackgroundColor = UIColor.themeColor(light: white, dark: actionCellBackgroundDark)
     public static let chatBackgroundColor = UIColor.themeColor(light: UIColor(red: 255, green: 255, blue: 255, alpha: 0), dark: .black)
     public static let checkmarkGreen = UIColor.themeColor(light: UIColor.rgb(red: 112, green: 177, blue: 92))
     public static let defaultTextColor = UIColor.themeColor(light: .darkText, dark: .white)

+ 2 - 1
deltachat-ios/Controller/ContactDetailViewController.swift

@@ -169,6 +169,7 @@ class ContactDetailViewController: UITableViewController {
         case .sharedChats:
             if let cell = tableView.dequeueReusableCell(withIdentifier: ContactCell.reuseIdentifier, for: indexPath) as? ContactCell {
                 viewModel.update(sharedChatCell: cell, row: row)
+                cell.backgroundColor = DcColors.sharedChatCellBackgroundColor
                 return cell
             }
         }
@@ -366,7 +367,7 @@ class ContactDetailViewController: UITableViewController {
             messageType3: DC_MSG_VIDEO
         ).reversed()
         let galleryController = GalleryViewController(mediaMessageIds: messageIds)
-            navigationController?.pushViewController(galleryController, animated: true)
+        navigationController?.pushViewController(galleryController, animated: true)
     }
 
     private func deleteChat() {

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

@@ -35,7 +35,7 @@ class ContactDetailHeader: UIView {
 
     init() {
         super.init(frame: .zero)
-        backgroundColor = DcColors.contactCellBackgroundColor
+        backgroundColor =  .clear
         setupSubviews()
     }
 

+ 0 - 1
deltachat-ios/ViewModel/ContactDetailViewModel.swift

@@ -102,7 +102,6 @@ class ContactDetailViewModel {
         let chatId = sharedChats.getChatId(index: index)
         let summary = sharedChats.getSummary(index: index)
         let unreadMessages = context.getUnreadMessages(chatId: chatId)
-
         let cellData = ChatCellData(chatId: chatId, summary: summary, unreadMessages: unreadMessages)
         let cellViewModel = ChatCellViewModel(dcContext: context, chatData: cellData)
         cell.updateCell(cellViewModel: cellViewModel)