diff --git a/Session/Closed Groups/NewClosedGroupVC.swift b/Session/Closed Groups/NewClosedGroupVC.swift index cde0e37f9..08d06a23d 100644 --- a/Session/Closed Groups/NewClosedGroupVC.swift +++ b/Session/Closed Groups/NewClosedGroupVC.swift @@ -25,7 +25,18 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate // MARK: - Components - private lazy var nameTextField = TextField(placeholder: "vc_create_closed_group_text_field_hint".localized()) + private lazy var nameTextField = TextField( + placeholder: "vc_create_closed_group_text_field_hint".localized(), + customHeight: 48 + ) + + private lazy var searchBar: ContactsSearchBar = { + let result = ContactsSearchBar() + result.tintColor = Colors.text + result.backgroundColor = .clear + result.delegate = self + return result + }() private lazy var tableView: TableView = { let result: TableView = TableView() @@ -40,6 +51,15 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate return result }() + private lazy var createGroupButton: Button = { + let result = Button(style: .prominentOutline, size: .large) + result.translatesAutoresizingMaskIntoConstraints = false + result.setTitle(NSLocalizedString("CREATE_GROUP_BUTTON_TITLE", comment: ""), for: .normal) + result.addTarget(self, action: #selector(createClosedGroup), for: .touchUpInside) + result.set(.width, to: 160) + return result + }() + // MARK: - Lifecycle override func viewDidLoad() { @@ -51,10 +71,6 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate let customTitleFontSize = Values.largeFontSize setNavBarTitle("vc_create_closed_group_title".localized(), customFontSize: customTitleFontSize) - let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(createClosedGroup)) - doneButton.tintColor = Colors.text - navigationItem.rightBarButtonItem = doneButton - // Set up content setUpViewHierarchy() } @@ -95,14 +111,22 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate nameTextField.pin(.leading, to: .leading, of: nameTextFieldContainer, withInset: Values.largeSpacing) nameTextField.pin(.top, to: .top, of: nameTextFieldContainer, withInset: Values.mediumSpacing) nameTextFieldContainer.pin(.trailing, to: .trailing, of: nameTextField, withInset: Values.largeSpacing) - nameTextFieldContainer.pin(.bottom, to: .bottom, of: nameTextField, withInset: Values.largeSpacing) + nameTextFieldContainer.pin(.bottom, to: .bottom, of: nameTextField) mainStackView.addArrangedSubview(nameTextFieldContainer) + let searchBarContainer: UIView = UIView() + searchBarContainer.addSubview(searchBar) + searchBar.pin(.leading, to: .leading, of: searchBarContainer, withInset: Values.largeSpacing) + searchBarContainer.pin(.trailing, to: .trailing, of: searchBar, withInset: Values.largeSpacing) + searchBar.pin([ UIView.VerticalEdge.top, UIView.VerticalEdge.bottom ], to: searchBarContainer) + mainStackView.addArrangedSubview(searchBarContainer) + let separator: UIView = UIView() separator.backgroundColor = Colors.separator separator.set(.height, to: Values.separatorThickness) mainStackView.addArrangedSubview(separator) - tableView.set(.height, to: CGFloat(contactProfiles.count * 65)) // A cell is exactly 65 points high + + tableView.set(.height, to: CGFloat(contactProfiles.count * 65 + 100)) // A cell is exactly 65 points high tableView.set(.width, to: UIScreen.main.bounds.width) mainStackView.addArrangedSubview(tableView) @@ -113,6 +137,10 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate scrollView.set(.width, to: UIScreen.main.bounds.width) scrollView.pin(to: view) + + view.addSubview(createGroupButton) + createGroupButton.center(.horizontal, in: view) + createGroupButton.pin(.bottom, to: .bottom, of: view, withInset: -Values.largeSpacing) } // MARK: - Table View Data Source @@ -127,7 +155,7 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate with: contactProfiles[indexPath.row].id, profile: contactProfiles[indexPath.row], isZombie: false, - accessory: .tick(isSelected: selectedContacts.contains(contactProfiles[indexPath.row].id)) + accessory: .o(isSelected: selectedContacts.contains(contactProfiles[indexPath.row].id)) ) return cell @@ -222,3 +250,19 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate SessionApp.homeViewController.wrappedValue?.createNewDM() } } + +extension NewClosedGroupVC: UISearchBarDelegate { + func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { +// searchText = searchText + } + + func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool { + searchBar.showsCancelButton = true + return true + } + + func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { + searchBar.showsCancelButton = false + searchBar.resignFirstResponder() + } +} diff --git a/Session/Home/New Conversation/NewConversationVC.swift b/Session/Home/New Conversation/NewConversationVC.swift index a3e6f8b80..abb4a6342 100644 --- a/Session/Home/New Conversation/NewConversationVC.swift +++ b/Session/Home/New Conversation/NewConversationVC.swift @@ -57,7 +57,6 @@ final class NewConversationVC: BaseVC, UITableViewDelegate, UITableViewDataSourc result.delegate = self result.dataSource = self result.separatorStyle = .none - result.backgroundColor = .clear if #available(iOS 15.0, *) { result.sectionHeaderTopPadding = 0 } diff --git a/Session/Meta/Translations/de.lproj/Localizable.strings b/Session/Meta/Translations/de.lproj/Localizable.strings index 6003e6b7b..fbb9d0a7b 100644 --- a/Session/Meta/Translations/de.lproj/Localizable.strings +++ b/Session/Meta/Translations/de.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/en.lproj/Localizable.strings b/Session/Meta/Translations/en.lproj/Localizable.strings index 5882cfe9d..bf821c76b 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/es.lproj/Localizable.strings b/Session/Meta/Translations/es.lproj/Localizable.strings index c3417fcb8..7c896c426 100644 --- a/Session/Meta/Translations/es.lproj/Localizable.strings +++ b/Session/Meta/Translations/es.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/fa.lproj/Localizable.strings b/Session/Meta/Translations/fa.lproj/Localizable.strings index 376c9fef2..fa822d4a4 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/fi.lproj/Localizable.strings b/Session/Meta/Translations/fi.lproj/Localizable.strings index fab1796fc..b06cdc31f 100644 --- a/Session/Meta/Translations/fi.lproj/Localizable.strings +++ b/Session/Meta/Translations/fi.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/fr.lproj/Localizable.strings b/Session/Meta/Translations/fr.lproj/Localizable.strings index 4aa6df8c7..c564eedf9 100644 --- a/Session/Meta/Translations/fr.lproj/Localizable.strings +++ b/Session/Meta/Translations/fr.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/hi.lproj/Localizable.strings b/Session/Meta/Translations/hi.lproj/Localizable.strings index 547aaf898..38d0aaa3c 100644 --- a/Session/Meta/Translations/hi.lproj/Localizable.strings +++ b/Session/Meta/Translations/hi.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/hr.lproj/Localizable.strings b/Session/Meta/Translations/hr.lproj/Localizable.strings index 22a823cde..10e7cf66e 100644 --- a/Session/Meta/Translations/hr.lproj/Localizable.strings +++ b/Session/Meta/Translations/hr.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/id-ID.lproj/Localizable.strings b/Session/Meta/Translations/id-ID.lproj/Localizable.strings index 7b172b46e..664cdc9d5 100644 --- a/Session/Meta/Translations/id-ID.lproj/Localizable.strings +++ b/Session/Meta/Translations/id-ID.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/it.lproj/Localizable.strings b/Session/Meta/Translations/it.lproj/Localizable.strings index 0f32f24c3..15dcfe6a1 100644 --- a/Session/Meta/Translations/it.lproj/Localizable.strings +++ b/Session/Meta/Translations/it.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/ja.lproj/Localizable.strings b/Session/Meta/Translations/ja.lproj/Localizable.strings index e197da23d..9ea198e6f 100644 --- a/Session/Meta/Translations/ja.lproj/Localizable.strings +++ b/Session/Meta/Translations/ja.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/nl.lproj/Localizable.strings b/Session/Meta/Translations/nl.lproj/Localizable.strings index 92f32dcc2..6e4d9bc35 100644 --- a/Session/Meta/Translations/nl.lproj/Localizable.strings +++ b/Session/Meta/Translations/nl.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/pl.lproj/Localizable.strings b/Session/Meta/Translations/pl.lproj/Localizable.strings index 19147da98..f7195741a 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings index 29b74acd7..1b1356673 100644 --- a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/ru.lproj/Localizable.strings b/Session/Meta/Translations/ru.lproj/Localizable.strings index 4e3339ddb..107c52d47 100644 --- a/Session/Meta/Translations/ru.lproj/Localizable.strings +++ b/Session/Meta/Translations/ru.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/si.lproj/Localizable.strings b/Session/Meta/Translations/si.lproj/Localizable.strings index 32fb6bb0a..7edcbe9ba 100644 --- a/Session/Meta/Translations/si.lproj/Localizable.strings +++ b/Session/Meta/Translations/si.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/sk.lproj/Localizable.strings b/Session/Meta/Translations/sk.lproj/Localizable.strings index a2857c651..173e89238 100644 --- a/Session/Meta/Translations/sk.lproj/Localizable.strings +++ b/Session/Meta/Translations/sk.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/sv.lproj/Localizable.strings b/Session/Meta/Translations/sv.lproj/Localizable.strings index d21c5e0e5..3a6c4a95c 100644 --- a/Session/Meta/Translations/sv.lproj/Localizable.strings +++ b/Session/Meta/Translations/sv.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/th.lproj/Localizable.strings b/Session/Meta/Translations/th.lproj/Localizable.strings index a52f6dac4..ffb45d92c 100644 --- a/Session/Meta/Translations/th.lproj/Localizable.strings +++ b/Session/Meta/Translations/th.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings index 3f57c112f..4026058e7 100644 --- a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings +++ b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings index 72a927869..80405ed4c 100644 --- a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings index 61234e864..b8256a883 100644 --- a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings @@ -707,3 +707,4 @@ "EMOJI_REACTS_MORE_REACTORS_MUTIPLE" = "And %@ others have reacted %@ to this message."; /* New conversation screen*/ "vc_new_conversation_title" = "New Conversation"; +"CREATE_GROUP_BUTTON_TITLE" = "Create"; diff --git a/Session/Shared/UserCell.swift b/Session/Shared/UserCell.swift index 45a523552..faae08644 100644 --- a/Session/Shared/UserCell.swift +++ b/Session/Shared/UserCell.swift @@ -11,6 +11,7 @@ final class UserCell: UITableViewCell { case none case lock case tick(isSelected: Bool) + case o(isSelected: Bool) case x } @@ -35,6 +36,8 @@ final class UserCell: UITableViewCell { return result }() + + private lazy var roundSelectionView = RoundSelectionView() private lazy var separator: UIView = { let result: UIView = UIView() @@ -80,7 +83,8 @@ final class UserCell: UITableViewCell { UIView.hSpacer(Values.mediumSpacing), displayNameLabel, spacer, - accessoryImageView + accessoryImageView, + roundSelectionView ] ) stackView.axis = .horizontal @@ -134,26 +138,64 @@ final class UserCell: UITableViewCell { ) switch accessory { - case .none: accessoryImageView.isHidden = true - + case .none: + accessoryImageView.isHidden = true + roundSelectionView.isHidden = true case .lock: + roundSelectionView.isHidden = true accessoryImageView.isHidden = false accessoryImageView.image = #imageLiteral(resourceName: "ic_lock_outline").withRenderingMode(.alwaysTemplate) accessoryImageView.tintColor = Colors.text.withAlphaComponent(Values.mediumOpacity) case .tick(let isSelected): + roundSelectionView.isHidden = true let icon: UIImage = (isSelected ? #imageLiteral(resourceName: "CircleCheck") : #imageLiteral(resourceName: "Circle")) accessoryImageView.isHidden = false accessoryImageView.image = icon.withRenderingMode(.alwaysTemplate) accessoryImageView.tintColor = Colors.text case .x: + roundSelectionView.isHidden = true accessoryImageView.isHidden = false accessoryImageView.image = #imageLiteral(resourceName: "X").withRenderingMode(.alwaysTemplate) accessoryImageView.contentMode = .center accessoryImageView.tintColor = Colors.text + case .o(let isSelected): + accessoryImageView.isHidden = true + roundSelectionView.isHidden = false + roundSelectionView.update(isSelected: isSelected) } let alpha: CGFloat = (isZombie ? 0.5 : 1) [ profilePictureView, displayNameLabel, accessoryImageView ].forEach { $0.alpha = alpha } } } + +fileprivate class RoundSelectionView: UIView { + + private lazy var centralView: UIView = { + let result = UIView() + result.backgroundColor = Colors.accent + return result + }() + + init() { + super.init(frame: CGRect.zero) + self.addSubview(centralView) + self.set(.width, to: 20) + self.set(.height, to: 20) + self.layer.cornerRadius = 10 + self.layer.borderWidth = 1 + self.layer.borderColor = Colors.text.cgColor + + centralView.pin(to: self, withInset: 3) + centralView.layer.cornerRadius = 7 + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func update(isSelected: Bool) { + centralView.isHidden = !isSelected + } +} diff --git a/SessionUIKit/Components/SearchBar.swift b/SessionUIKit/Components/SearchBar.swift index 830f0973f..731c1f52b 100644 --- a/SessionUIKit/Components/SearchBar.swift +++ b/SessionUIKit/Components/SearchBar.swift @@ -13,6 +13,19 @@ public final class SearchBar : UISearchBar { } } +public final class ContactsSearchBar : UISearchBar { + + public override init(frame: CGRect) { + super.init(frame: frame) + setUpContactSearchStyle() + } + + public required init?(coder: NSCoder) { + super.init(coder: coder) + setUpContactSearchStyle() + } +} + public extension UISearchBar { func setUpSessionStyle() { @@ -31,4 +44,21 @@ public extension UISearchBar { searchTextPositionAdjustment = UIOffset(horizontal: 2, vertical: 0) setPositionAdjustment(UIOffset(horizontal: -4, vertical: 0), for: UISearchBar.Icon.clear) } + + func setUpContactSearchStyle() { + searchBarStyle = .minimal + barStyle = .default + tintColor = Colors.text + let searchImage = #imageLiteral(resourceName: "searchbar_search").withTint(Colors.text)! + setImage(searchImage, for: .search, state: .normal) + let clearImage = #imageLiteral(resourceName: "searchbar_clear").withTint(Colors.text)! + setImage(clearImage, for: .clear, state: .normal) + let searchTextField: UITextField = self.searchTextField + searchTextField.backgroundColor = .white // The search bar background color + searchTextField.textColor = Colors.text + searchTextField.attributedPlaceholder = NSAttributedString(string: "Search Contacts", attributes: [ .foregroundColor : Colors.searchBarPlaceholder ]) + setPositionAdjustment(UIOffset(horizontal: 4, vertical: 0), for: UISearchBar.Icon.search) + searchTextPositionAdjustment = UIOffset(horizontal: 2, vertical: 0) + setPositionAdjustment(UIOffset(horizontal: -4, vertical: 0), for: UISearchBar.Icon.clear) + } } diff --git a/SessionUIKit/Style Guide/Colors.swift b/SessionUIKit/Style Guide/Colors.swift index 3059b4518..fc86b45a6 100644 --- a/SessionUIKit/Style Guide/Colors.swift +++ b/SessionUIKit/Style Guide/Colors.swift @@ -50,4 +50,5 @@ public final class Colors : NSObject { @objc public static var sessionMessageRequestsTitle: UIColor { UIColor(named: "session_message_requests_title")! } @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")! } } diff --git a/SessionUIKit/Style Guide/Colors.xcassets/session_contacts_search_bar_background.colorset/Contents.json b/SessionUIKit/Style Guide/Colors.xcassets/session_contacts_search_bar_background.colorset/Contents.json new file mode 100644 index 000000000..9c0e331e9 --- /dev/null +++ b/SessionUIKit/Style Guide/Colors.xcassets/session_contacts_search_bar_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" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}