Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New Design for Creating New Group Conversation Screen to match Design Specs - WPB-11589 #2036

Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
88b14cb
feat: Remove the optionsToggle the cells are going to show by default
agisilaos Jul 2, 2024
7c2aea0
chore: Delete unused code
agisilaos Jul 2, 2024
dcb0f0b
feat: Implement new design [introduce new Conversation Options]
agisilaos Jul 2, 2024
99134bc
feat: Update the design for SectionHeader and SectionFooterView
agisilaos Jul 2, 2024
d4ce0d2
feat: Introduce WireTextField
agisilaos Jul 2, 2024
986ff25
feat: Introduce new design for the textfield
agisilaos Jul 3, 2024
49cb692
chore: Groom and fix issue with navigation bar
agisilaos Jul 3, 2024
6262b28
fix: Font for nav bar item
agisilaos Jul 3, 2024
99642b9
Merge remote-tracking branch 'origin/epic/navigation-overhaul-WPB-664…
agisilaos Jul 10, 2024
3dcd648
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Jul 18, 2024
edf1ec9
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Aug 8, 2024
47f1a3f
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Sep 3, 2024
d02a5f8
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Oct 4, 2024
bd0b53e
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Oct 15, 2024
0fecd55
Fix Error
agisilaos Oct 15, 2024
a06c98e
Fix issue where next button would be still disabled
agisilaos Oct 15, 2024
8cff472
Update Tests
agisilaos Oct 15, 2024
d0c13df
Update reference images for tests
agisilaos Oct 15, 2024
fb15bf9
Set color for the label expliciitly
agisilaos Oct 15, 2024
98f008c
Add SectionFooterView to its own file
agisilaos Oct 15, 2024
25d6174
Add SectionTableFooter to its own file
agisilaos Oct 15, 2024
d021dfa
Fix SwiftLint Warnings
agisilaos Oct 15, 2024
452d884
Set up notification using Combine
agisilaos Oct 15, 2024
a3306b4
Remove unnecessary code
agisilaos Oct 15, 2024
01d2c4f
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Oct 16, 2024
7d4f29f
Fix clipping for groupNameLabel
agisilaos Oct 16, 2024
310a8f5
Make properties private
agisilaos Oct 16, 2024
bd6fdc3
Use Localizable strings instead of plain text
agisilaos Oct 16, 2024
d7178e2
Split setup in multiple methods for better readability
agisilaos Oct 16, 2024
0042dc7
Move WireTextFieldDelegate to its own file
agisilaos Oct 16, 2024
24e6459
Groom
agisilaos Oct 16, 2024
aba6842
Move line into the setup method
agisilaos Oct 16, 2024
9e0d1bf
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Oct 16, 2024
402e019
Merge branch 'epic/navigation-overhaul-WPB-6647' into feat/Update-Cre…
agisilaos Oct 16, 2024
5679a79
Update `FolderCreationControllerSnapshotTests`
agisilaos Oct 17, 2024
8064551
Update `GroupDetailsViewControllerSnapshotTests`
agisilaos Oct 17, 2024
5854fdf
Update `ProfileDetailsViewControllerTests`
agisilaos Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class ConversationCreationControllerSnapshotTests: XCTestCase {
snapshotHelper.verify(matching: sut)
}

func testTeamGroupOptionsCollapsed() {
func testTeamGroupOptions() {
createSut(isTeamMember: true)

snapshotHelper
Expand All @@ -77,13 +77,6 @@ final class ConversationCreationControllerSnapshotTests: XCTestCase {
)
}

func testTeamGroupOptionsExpanded() {
createSut(isTeamMember: true)
sut.expandOptions()

snapshotHelper.verify(matching: sut)
}

// MARK: - Helper Method

private func createSut(isTeamMember: Bool) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 12 additions & 8 deletions wire-ios/Wire-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions wire-ios/Wire-iOS/Generated/Strings+Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2410,8 +2410,8 @@ internal enum L10n {
internal static func subtitle(_ p1: Any, _ p2: Any, _ p3: Any) -> String {
return L10n.tr("Localizable", "conversation.create.options.subtitle", String(describing: p1), String(describing: p2), String(describing: p3), fallback: "Guests: %@, Services: %@, Read receipts: %@")
}
/// Conversation options
internal static let title = L10n.tr("Localizable", "conversation.create.options.title", fallback: "Conversation options")
/// CONVERSATION OPTIONS
internal static let title = L10n.tr("Localizable", "conversation.create.options.title", fallback: "CONVERSATION OPTIONS")
}
internal enum ProtocolSelection {
/// MLS
Expand Down
2 changes: 1 addition & 1 deletion wire-ios/Wire-iOS/Resources/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
"conversation.create.group_name.placeholder" = "Group name";
"conversation.create.guidance.empty" = "At least 1 character";
"conversation.create.guidance.toolong" = "Too many characters";
"conversation.create.options.title" = "Conversation options";
"conversation.create.options.title" = "CONVERSATION OPTIONS";
agisilaos marked this conversation as resolved.
Show resolved Hide resolved
"conversation.create.options.subtitle" = "Guests: %@, Services: %@, Read receipts: %@";
"conversation.create.guests.title" = "Allow guests";
"conversation.create.guests.subtitle" = "Open this conversation to people outside your team.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,7 @@
//

import UIKit

final class SectionFooterView: UIView {

let titleLabel = UILabel()

override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
createConstraints()
}

@available(*, unavailable)
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private func setupViews() {
titleLabel.font = .preferredFont(forTextStyle: .footnote)
titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.numberOfLines = 0
titleLabel.applyStyle(.footerLabel)
addSubview(titleLabel)
}

private func createConstraints() {
NSLayoutConstraint.activate([
titleLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16),
titleLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
titleLabel.topAnchor.constraint(equalTo: topAnchor, constant: 16),
titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -8)
])
}

}
import WireDesign

final class SectionFooter: UICollectionReusableView {

Expand All @@ -76,25 +43,3 @@ final class SectionFooter: UICollectionReusableView {
collectionView.register(SectionFooter.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "SectionFooter")
}
}

final class SectionTableFooter: UITableViewHeaderFooterView {

let footerView = SectionFooterView()

var titleLabel: UILabel {
return footerView.titleLabel
}

override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
addSubview(footerView)
footerView.translatesAutoresizingMaskIntoConstraints = false
footerView.fitIn(view: self)
}

@available(*, unavailable)
required init?(coder aDecoder: NSCoder) {
fatalError("init?(coder aDecoder: NSCoder) is not implemented")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// Wire
// Copyright (C) 2024 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

import UIKit
import WireDesign

final class SectionFooterView: UIView {

let titleLabel = DynamicFontLabel(
KaterinaWire marked this conversation as resolved.
Show resolved Hide resolved
style: .subline1,
color: SemanticColors.Label.textSectionFooter
)

override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
titleLabel.lineBreakMode = .byWordWrapping
agisilaos marked this conversation as resolved.
Show resolved Hide resolved
createConstraints()
}

@available(*, unavailable)
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private func setupViews() {
titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.numberOfLines = 0
titleLabel.textColor = SemanticColors.Label.textSectionFooter
addSubview(titleLabel)
}

private func createConstraints() {
NSLayoutConstraint.activate([
titleLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16),
titleLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
titleLabel.topAnchor.constraint(equalTo: topAnchor, constant: 8),
titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -16)
])
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ import WireDesign

final class SectionHeaderView: UIView {

let titleLabel = DynamicFontLabel(style: .h5,
color: SemanticColors.Label.textSectionHeader)
let titleLabel = DynamicFontLabel(
agisilaos marked this conversation as resolved.
Show resolved Hide resolved
style: .h5,
color: SemanticColors.Label.textSectionHeader
KaterinaWire marked this conversation as resolved.
Show resolved Hide resolved
)

override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
createConstraints()

}

@available(*, unavailable)
Expand All @@ -53,7 +54,6 @@ final class SectionHeaderView: UIView {
titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -8)
])
}

}

final class SectionHeader: UICollectionReusableView {
Expand All @@ -68,14 +68,22 @@ final class SectionHeader: UICollectionReusableView {
super.init(frame: frame)
addSubview(headerView)
headerView.translatesAutoresizingMaskIntoConstraints = false
headerView.fitIn(view: self)
createConstraints()
}

@available(*, unavailable)
required init?(coder aDecoder: NSCoder) {
fatalError("init?(coder aDecoder: NSCoder) is not implemented")
}

private func createConstraints() {
NSLayoutConstraint.activate([
headerView.leadingAnchor.constraint(equalTo: leadingAnchor),
headerView.topAnchor.constraint(equalTo: topAnchor),
headerView.trailingAnchor.constraint(equalTo: trailingAnchor),
headerView.bottomAnchor.constraint(equalTo: bottomAnchor)
])
}
}

final class SectionTableHeader: UITableViewHeaderFooterView {
Expand Down Expand Up @@ -107,5 +115,4 @@ final class SectionTableHeader: UITableViewHeaderFooterView {
headerView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor)
])
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Wire
// Copyright (C) 2024 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

import UIKit
import WireDesign

final class SectionTableFooter: UITableViewHeaderFooterView {

let footerView = SectionFooterView()
agisilaos marked this conversation as resolved.
Show resolved Hide resolved

var titleLabel: UILabel {
agisilaos marked this conversation as resolved.
Show resolved Hide resolved
KaterinaWire marked this conversation as resolved.
Show resolved Hide resolved
return footerView.titleLabel
}

override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
addSubview(footerView)
footerView.translatesAutoresizingMaskIntoConstraints = false
footerView.fitIn(view: self)
}

@available(*, unavailable)
required init?(coder aDecoder: NSCoder) {
fatalError("init?(coder aDecoder: NSCoder) is not implemented")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@
// along with this program. If not, see http://www.gnu.org/licenses/.
//

import Combine
import UIKit
import WireCommonComponents
import WireDesign

final class ConversationCreateNameCell: UICollectionViewCell {

let textField = SimpleTextField()
private let stackView = UIStackView()
private let groupNameLabel = DynamicFontLabel(
text: "Group name",
KaterinaWire marked this conversation as resolved.
Show resolved Hide resolved
style: .h4,
color: SemanticColors.Label.textUserPropertyCellName
)

let textField = WireTextField()

private var cancellables = Set<AnyCancellable>()

override init(frame: CGRect) {
super.init(frame: frame)
Expand All @@ -32,15 +44,56 @@ final class ConversationCreateNameCell: UICollectionViewCell {
fatalError("init?(coder aDecoder: NSCoder) is not implemented")
}

fileprivate func setup() {
textField.translatesAutoresizingMaskIntoConstraints = false
textField.isAccessibilityElement = true
textField.accessibilityIdentifier = "textfield.newgroup.name"
textField.placeholder = L10n.Localizable.Conversation.Create.GroupName.placeholder.localizedUppercase
textField.accessibilityValue = L10n.Accessibility.CreateConversation.SearchView.description
private func setup() {
setupStackView()
setupGroupNameLabel()
setupTextField()
setupConstraints()
setupNotifications()
}

private func setupStackView() {
stackView.axis = .vertical
stackView.spacing = 8
stackView.alignment = .fill
stackView.distribution = .fill
stackView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(stackView)
}

private func setupGroupNameLabel() {
stackView.addArrangedSubview(groupNameLabel)
}

private func setupTextField() {
textField.borderStyle = .roundedRect
textField.layer.borderColor = SemanticColors.SearchBar.borderInputView.cgColor
textField.font = .font(for: .body1)
stackView.addArrangedSubview(textField)
}

private func setupConstraints() {
NSLayoutConstraint.activate([
stackView.topAnchor.constraint(equalTo: contentView.topAnchor),
stackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16),
stackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -16),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: contentView.bottomAnchor),

textField.heightAnchor.constraint(equalToConstant: 46)
])
}

contentView.addSubview(textField)
textField.fitIn(view: contentView)
private func setupNotifications() {
NotificationCenter.default.publisher(for: UITextField.textDidBeginEditingNotification, object: textField)
.sink { [weak self] _ in
self?.groupNameLabel.textColor = UIColor.accent()
}
.store(in: &cancellables)

NotificationCenter.default.publisher(for: UITextField.textDidEndEditingNotification, object: textField)
.sink { [weak self] _ in
self?.groupNameLabel.textColor = SemanticColors.Label.textUserPropertyCellName
}
.store(in: &cancellables)
agisilaos marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading
Loading