diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 4e32b6635..53a834bc0 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -6850,7 +6850,8 @@ static CGSize kThreadListBarButtonItemImageSize; self.threadsBetaBridgePresenter = nil; } - self.threadsBetaBridgePresenter = [[ThreadsBetaCoordinatorBridgePresenter alloc] initWithThreadId:event.eventId]; + self.threadsBetaBridgePresenter = [[ThreadsBetaCoordinatorBridgePresenter alloc] initWithThreadId:event.eventId + infoText:VectorL10n.threadsBetaInformation]; self.threadsBetaBridgePresenter.delegate = self; [self.threadsBetaBridgePresenter presentFrom:self.presentedViewController?:self animated:YES]; diff --git a/Riot/Modules/Threads/Beta/ThreadsBetaCoordinator.swift b/Riot/Modules/Threads/Beta/ThreadsBetaCoordinator.swift index 82369c268..38a425556 100644 --- a/Riot/Modules/Threads/Beta/ThreadsBetaCoordinator.swift +++ b/Riot/Modules/Threads/Beta/ThreadsBetaCoordinator.swift @@ -26,8 +26,9 @@ final class ThreadsBetaCoordinator: NSObject, ThreadsBetaCoordinatorProtocol { // MARK: Private private let threadId: String + private let infoText: String private lazy var viewController: ThreadsBetaViewController = { - let result = ThreadsBetaViewController.instantiate() + let result = ThreadsBetaViewController.instantiate(infoText: infoText) result.didTapEnableButton = { [weak self] in guard let self = self else { return } RiotSettings.shared.enableThreads = true @@ -50,8 +51,9 @@ final class ThreadsBetaCoordinator: NSObject, ThreadsBetaCoordinatorProtocol { // MARK: - Setup - init(threadId: String) { + init(threadId: String, infoText: String) { self.threadId = threadId + self.infoText = infoText } // MARK: - Public diff --git a/Riot/Modules/Threads/Beta/ThreadsBetaCoordinatorBridgePresenter.swift b/Riot/Modules/Threads/Beta/ThreadsBetaCoordinatorBridgePresenter.swift index a4b1e256b..afd239904 100644 --- a/Riot/Modules/Threads/Beta/ThreadsBetaCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Threads/Beta/ThreadsBetaCoordinatorBridgePresenter.swift @@ -38,6 +38,7 @@ final class ThreadsBetaCoordinatorBridgePresenter: NSObject { // MARK: Private public let threadId: String + public let infoText: String private let slidingModalPresenter = SlidingModalPresenter() private var coordinator: ThreadsBetaCoordinator? @@ -47,8 +48,9 @@ final class ThreadsBetaCoordinatorBridgePresenter: NSObject { // MARK: - Setup - init(threadId: String) { + init(threadId: String, infoText: String) { self.threadId = threadId + self.infoText = infoText super.init() } @@ -56,7 +58,7 @@ final class ThreadsBetaCoordinatorBridgePresenter: NSObject { func present(from viewController: UIViewController, animated: Bool) { - let threadsBetaCoordinator = ThreadsBetaCoordinator(threadId: threadId) + let threadsBetaCoordinator = ThreadsBetaCoordinator(threadId: threadId, infoText: infoText) threadsBetaCoordinator.delegate = self guard let presentable = threadsBetaCoordinator.toPresentable() as? SlidingModalPresentable.ViewControllerType else { MXLog.error("[ThreadsBetaCoordinatorBridgePresenter] Presentable is not 'SlidingModalPresentable'") diff --git a/Riot/Modules/Threads/Beta/ThreadsBetaViewController.swift b/Riot/Modules/Threads/Beta/ThreadsBetaViewController.swift index ee90da94f..d94287b5a 100644 --- a/Riot/Modules/Threads/Beta/ThreadsBetaViewController.swift +++ b/Riot/Modules/Threads/Beta/ThreadsBetaViewController.swift @@ -39,6 +39,7 @@ class ThreadsBetaViewController: UIViewController { // MARK: Private private var theme: Theme! + private var infoText: String! // MARK: Public @@ -69,9 +70,10 @@ class ThreadsBetaViewController: UIViewController { // MARK: - Setup - @objc class func instantiate() -> ThreadsBetaViewController { + @objc class func instantiate(infoText: String) -> ThreadsBetaViewController { let viewController = StoryboardScene.ThreadsBetaViewController.initialScene.instantiate() viewController.theme = ThemeService.shared().theme + viewController.infoText = infoText return viewController } @@ -98,7 +100,7 @@ class ThreadsBetaViewController: UIViewController { guard let font = self.informationTextView.font else { return } - let attributedString = NSMutableAttributedString(string: VectorL10n.threadsBetaInformation, + let attributedString = NSMutableAttributedString(string: infoText, attributes: [.font: font]) let link = NSAttributedString(string: VectorL10n.threadsBetaInformationLink, attributes: [.link: Constants.learnMoreLink,