diff --git a/Session/Home/New Conversation/NewConversationVC.swift b/Session/Home/New Conversation/NewConversationVC.swift index abb4a6342..ef4441192 100644 --- a/Session/Home/New Conversation/NewConversationVC.swift +++ b/Session/Home/New Conversation/NewConversationVC.swift @@ -53,10 +53,10 @@ final class NewConversationVC: BaseVC, UITableViewDelegate, UITableViewDataSourc }() private lazy var contactsTableView: UITableView = { - let result = UITableView() + let result = UITableView(frame: .zero, style: .grouped) result.delegate = self result.dataSource = self - result.separatorStyle = .none + result.backgroundColor = Colors.navigationBarBackground if #available(iOS 15.0, *) { result.sectionHeaderTopPadding = 0 } @@ -85,14 +85,15 @@ final class NewConversationVC: BaseVC, UITableViewDelegate, UITableViewDataSourc frame: CGRect( x: 0, y: 0, width: UIScreen.main.bounds.width, - height: NewConversationButton.height * 3 + Values.smallSpacing * 2 + Values.mediumFontSize + height: NewConversationButton.height * 3 + Values.mediumSpacing * 2 + Values.mediumFontSize ) ) headerView.addSubview(buttonStackViewContainer) - buttonStackViewContainer.pin([ UIView.HorizontalEdge.leading, UIView.HorizontalEdge.trailing, UIView.VerticalEdge.top ], to: headerView) + buttonStackViewContainer.pin([ UIView.HorizontalEdge.leading, UIView.HorizontalEdge.trailing], to: headerView) + buttonStackViewContainer.pin(.top, to: .top, of: headerView, withInset: Values.verySmallSpacing) headerView.addSubview(contactsTitleLabel) contactsTitleLabel.pin(.leading, to: .leading, of: headerView, withInset: Values.mediumSpacing) - contactsTitleLabel.pin(.top, to: .bottom, of: buttonStackViewContainer, withInset: Values.smallSpacing) + contactsTitleLabel.pin(.top, to: .bottom, of: buttonStackViewContainer, withInset: Values.mediumSpacing) contactsTableView.tableHeaderView = headerView view.addSubview(contactsTableView) @@ -112,6 +113,7 @@ final class NewConversationVC: BaseVC, UITableViewDelegate, UITableViewDataSourc func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell: UserCell = tableView.dequeue(type: UserCell.self, for: indexPath) let profile = newConversationViewModel.sectionData[indexPath.section].contacts[indexPath.row] + cell.backgroundColor = Colors.sessionNewConversationCellBackground cell.update( with: profile.id, profile: profile, @@ -151,6 +153,10 @@ final class NewConversationVC: BaseVC, UITableViewDelegate, UITableViewDataSourc SessionApp.presentConversation(for: sessionId, action: .compose, animated: false) } + func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { + view.backgroundColor = Colors.navigationBarBackground + } + // MARK: - Interaction @objc private func handleTap(_ gestureRecognizer: UITapGestureRecognizer) { @@ -201,6 +207,7 @@ private final class NewConversationButton: UIView { self.title = title self.shouldShowSeparator = shouldShowSeparator super.init(frame: .zero) + self.backgroundColor = Colors.sessionNewConversationCellBackground setUpViewHierarchy() } diff --git a/SessionUIKit/Style Guide/Colors.swift b/SessionUIKit/Style Guide/Colors.swift index fc86b45a6..9749710b2 100644 --- a/SessionUIKit/Style Guide/Colors.swift +++ b/SessionUIKit/Style Guide/Colors.swift @@ -51,4 +51,5 @@ public final class Colors : NSObject { @objc public static var sessionMessageRequestsInfoText: UIColor { UIColor(named: "session_message_requests_info_text")! } @objc public static var sessionEmojiPlusButtonBackground: UIColor { UIColor(named: "session_emoji_plus_button_background")! } @objc public static var sessionContactsSearchBarBackground: UIColor { UIColor(named: "session_contacts_search_bar_background")! } + @objc public static var sessionNewConversationCellBackground: UIColor { UIColor(named: "session_new_conversation_cell_background")! } } diff --git a/SessionUIKit/Style Guide/Colors.xcassets/session_cell_background.colorset/Contents.json b/SessionUIKit/Style Guide/Colors.xcassets/session_cell_background.colorset/Contents.json index 9cece1931..0ecfa5c92 100644 --- a/SessionUIKit/Style Guide/Colors.xcassets/session_cell_background.colorset/Contents.json +++ b/SessionUIKit/Style Guide/Colors.xcassets/session_cell_background.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "252", - "green" : "252", - "red" : "252" + "blue" : "0xFC", + "green" : "0xFC", + "red" : "0xFC" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "22", - "green" : "22", - "red" : "22" + "blue" : "0x16", + "green" : "0x16", + "red" : "0x16" } }, "idiom" : "universal" diff --git a/SessionUIKit/Style Guide/Colors.xcassets/session_new_conversation_cell_background.colorset/Contents.json b/SessionUIKit/Style Guide/Colors.xcassets/session_new_conversation_cell_background.colorset/Contents.json new file mode 100644 index 000000000..e24ec0831 --- /dev/null +++ b/SessionUIKit/Style Guide/Colors.xcassets/session_new_conversation_cell_background.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x1B", + "green" : "0x1B", + "red" : "0x1B" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}