mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Get information text as a parameter in threads beta view
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'")
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user