SP3.1: Update room settings for Spaces element-ios#5231

- Changed the Room Settings screen according to the new design
- Implemented the room access flow
- Added room upgrade support
- Implemented the room suggestion screen
This commit is contained in:
Gil Eluard
2022-01-13 15:53:45 +01:00
parent 085fc7d5b0
commit ce226cff8a
78 changed files with 3755 additions and 196 deletions
@@ -55,6 +55,7 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
}
let settings = RoomSettingsViewController()
settings.delegate = self
settings.finalizeInit()
settings.screenTimer = AnalyticsScreenTimer(screen: .roomSettings)
settings.initWith(self.session, andRoomId: self.room.roomId)
@@ -114,7 +115,9 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
self.add(childCoordinator: rootCoordinator)
if self.navigationRouter.modules.isEmpty == false {
self.navigationRouter.push(rootCoordinator.toPresentable(), animated: true, popCompletion: nil)
// push room info screen non animated if another screen needs to be pushed just after
let animated = initialSection == .none
self.navigationRouter.push(rootCoordinator.toPresentable(), animated: animated, popCompletion: nil)
} else {
self.navigationRouter.setRootModule(rootCoordinator)
}
@@ -126,6 +129,8 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
self.showRoomDetails(with: .settings(RoomSettingsViewControllerFieldAvatar), animated: false)
case .changeTopic:
self.showRoomDetails(with: .settings(RoomSettingsViewControllerFieldTopic), animated: false)
case .settings:
self.showRoomDetails(with: .settings(RoomSettingsViewControllerFieldNone), animated: false)
case .none:
break
}
@@ -219,3 +224,9 @@ extension RoomInfoCoordinator: RoomNotificationSettingsCoordinatorDelegate {
}
}
extension RoomInfoCoordinator: RoomSettingsViewControllerDelegate {
func roomSettingsViewController(_ controller: RoomSettingsViewController!, didMoveRoomTo newRoomId: String!) {
self.delegate?.roomInfoCoordinator(self, didMoveToRoomWithId: newRoomId)
}
}
@@ -22,6 +22,7 @@ import Foundation
func roomInfoCoordinatorBridgePresenterDelegateDidComplete(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter)
func roomInfoCoordinatorBridgePresenter(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter, didRequestMentionForMember member: MXRoomMember)
func roomInfoCoordinatorBridgePresenterDelegateDidLeaveRoom(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter)
func roomInfoCoordinatorBridgePresenter(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter, didMoveToRoomWithId roomId: String)
}
/// RoomInfoCoordinatorBridgePresenter enables to start RoomInfoCoordinator from a view controller.
@@ -124,6 +125,10 @@ extension RoomInfoCoordinatorBridgePresenter: RoomInfoCoordinatorDelegate {
func roomInfoCoordinatorDidLeaveRoom(_ coordinator: RoomInfoCoordinatorType) {
self.delegate?.roomInfoCoordinatorBridgePresenterDelegateDidLeaveRoom(self)
}
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, didMoveToRoomWithId roomId: String) {
self.delegate?.roomInfoCoordinatorBridgePresenter(self, didMoveToRoomWithId: roomId)
}
}
// MARK: - UIAdaptivePresentationControllerDelegate
@@ -20,6 +20,7 @@ import Foundation
enum RoomInfoSection: Int {
case none
case addParticipants
case settings
case changeAvatar
case changeTopic
}
@@ -22,6 +22,7 @@ protocol RoomInfoCoordinatorDelegate: AnyObject {
func roomInfoCoordinatorDidComplete(_ coordinator: RoomInfoCoordinatorType)
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, didRequestMentionForMember member: MXRoomMember)
func roomInfoCoordinatorDidLeaveRoom(_ coordinator: RoomInfoCoordinatorType)
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, didMoveToRoomWithId roomId: String)
}
/// `RoomInfoCoordinatorType` is a protocol describing a Coordinator that handle keybackup setup navigation flow.