diff --git a/Ring/Ring/Extensions/UIImage+Helpers.swift b/Ring/Ring/Extensions/UIImage+Helpers.swift index c3629e067f70e66ce1d73760a7daa5c5ecd57424..be529a1ffe83ff3a553b822d9cc3a9d079878088 100644 --- a/Ring/Ring/Extensions/UIImage+Helpers.swift +++ b/Ring/Ring/Extensions/UIImage+Helpers.swift @@ -233,9 +233,10 @@ extension UIImage { return newImage } - func drawText(text: String, backgroundColor: UIColor, textColor: UIColor, size: CGSize) -> UIImage? { + func drawText(text: String, backgroundColor: UIColor, textColor: UIColor, size: CGSize, textFontSize: CGFloat? = nil) -> UIImage? { // Setups up the font attributes that will be later used to dictate how the text should be drawn - let textFont = UIFont.systemFont(ofSize: 20, weight: .semibold) + let textFontSize = textFontSize == nil ? 20 : textFontSize + let textFont = UIFont.systemFont(ofSize: textFontSize!, weight: .semibold) let textFontAttributes = [ NSAttributedString.Key.font: textFont, NSAttributedString.Key.foregroundColor: textColor] @@ -320,7 +321,7 @@ extension UIImage { return UIImage().drawText(text: username.prefixString().capitalized, backgroundColor: fbaBGColor, textColor: .white, - size: CGSize(width: size + 8, height: size + 8))?.circleMasked + size: CGSize(width: size + 8, height: size + 8), textFontSize: 14)?.circleMasked } return nil } diff --git a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift index 49e1b99408a1dcb99269b242c9ef64cb368ab600..d5a1de70ebb187a40676d4c16fc203d16181a1f5 100644 --- a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift +++ b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift @@ -264,7 +264,9 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased }) .disposed(by: self.disposeBag) self.navigationItem.leftBarButtonItem = accountButtonItem - self.navigationItem.rightBarButtonItems = [createSearchButton(), createMenuButton()] + let space = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil) + space.width = 20 + self.navigationItem.rightBarButtonItems = [createSearchButton(), space, createMenuButton()] self.conversationsTableView.tableFooterView = UIView() } @@ -487,13 +489,13 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased private func setupCommonUI(customNavBar: SmartListNavigationBar) { navigationItem.title = "" - widgetsTopConstraint.constant = 40 + widgetsTopConstraint.constant = 42 customNavBar.customHeight = 70 customNavBar.searchActive = true } private func setupUIForSipAccount(customNavBar: SmartListNavigationBar) { - let bookButton = createSearchBarButtonWithImage(named: "book.circle", weight: .light, width: 27) + let bookButton = createSearchBarButtonWithImage(named: "book.circle", weight: .regular, width: 27) bookButton.setImage(UIImage(asset: Asset.phoneBook), for: .normal) bookButton.rx.tap .subscribe(onNext: { [weak self] in @@ -501,7 +503,7 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased }) .disposed(by: customNavBar.disposeBag) - let dialpadCodeButton = createSearchBarButtonWithImage(named: "square.grid.3x3.topleft.filled", weight: .light, width: 25) + let dialpadCodeButton = createSearchBarButtonWithImage(named: "square.grid.3x3.topleft.filled", weight: .regular, width: 25) dialpadCodeButton.rx.tap .subscribe(onNext: { [weak self] in self?.viewModel.showDialpad() @@ -512,14 +514,14 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased } private func setupUIForNonSipAccount(customNavBar: SmartListNavigationBar) { - let qrCodeButton = createSearchBarButtonWithImage(named: "qrcode", weight: .regular, width: 25) + let qrCodeButton = createSearchBarButtonWithImage(named: "qrcode", weight: .medium, width: 25) qrCodeButton.rx.tap .subscribe(onNext: { [weak self] in self?.viewModel.showQRCode() }) .disposed(by: customNavBar.disposeBag) - let swarmButton = createSearchBarButtonWithImage(named: "person.2", weight: .regular, width: 32) + let swarmButton = createSearchBarButtonWithImage(named: "person.2", weight: .medium, width: 32) swarmButton.rx.tap .subscribe(onNext: { [weak self] in self?.viewModel.createGroup() diff --git a/Ring/Ring/UI/SmartListNavigationBar.swift b/Ring/Ring/UI/SmartListNavigationBar.swift index e1eafe732c153adcb634112da77209159e03f529..dccf674ae31d69f093ab018b2d62b9e615125206 100644 --- a/Ring/Ring/UI/SmartListNavigationBar.swift +++ b/Ring/Ring/UI/SmartListNavigationBar.swift @@ -25,7 +25,8 @@ class SmartListNavigationBar: UINavigationBar { private struct Constants { static let topViewHeight: CGFloat = 50.0 - static let buttonSpacing: CGFloat = -15.0 + static let buttonSpacing: CGFloat = -22.0 + static let trailing: CGFloat = -15.0 } var topView: UIView? @@ -83,7 +84,7 @@ private extension SmartListNavigationBar { let guide = self.safeAreaLayoutGuide NSLayoutConstraint.activate([ - view.topAnchor.constraint(equalTo: guide.topAnchor), + view.topAnchor.constraint(equalTo: guide.topAnchor, constant: -5), view.heightAnchor.constraint(equalToConstant: Constants.topViewHeight), view.leadingAnchor.constraint(equalTo: guide.leadingAnchor), view.trailingAnchor.constraint(equalTo: guide.trailingAnchor) @@ -97,7 +98,7 @@ private extension SmartListNavigationBar { let title = UILabel() title.text = L10n.Smartlist.searchBar - title.font = UIFont.systemFont(ofSize: 18, weight: .medium) + title.font = UIFont.systemFont(ofSize: 18, weight: .semibold) title.translatesAutoresizingMaskIntoConstraints = false topView.addSubview(title) @@ -118,7 +119,7 @@ private extension SmartListNavigationBar { if let prevBtn = previousButton { button.trailingAnchor.constraint(equalTo: prevBtn.leadingAnchor, constant: Constants.buttonSpacing).isActive = true } else { - button.trailingAnchor.constraint(equalTo: topView.trailingAnchor, constant: Constants.buttonSpacing).isActive = true + button.trailingAnchor.constraint(equalTo: topView.trailingAnchor, constant: Constants.trailing).isActive = true } button.centerYAnchor.constraint(equalTo: topView.centerYAnchor).isActive = true previousButton = button @@ -134,7 +135,7 @@ private extension SmartListNavigationBar { } if stringFromClass.contains("SearchBar") && searchActive { - subview.frame = CGRect(x: 0, y: 40, width: frame.width, height: subview.frame.height) + subview.frame = CGRect(x: 0, y: 36, width: frame.width, height: subview.frame.height) } } }