merged element 1.8.10

This commit is contained in:
Arnfried Griesert
2022-05-03 12:48:01 +02:00
1235 changed files with 50869 additions and 23132 deletions
@@ -18,6 +18,7 @@
*/
import UIKit
import CommonKit
import MatrixSDK
final class RoomInfoListViewController: UIViewController {
@@ -40,9 +41,10 @@ final class RoomInfoListViewController: UIViewController {
private var viewModel: RoomInfoListViewModelType!
private var theme: Theme!
private var errorPresenter: MXKErrorPresentation!
private var activityPresenter: ActivityIndicatorPresenter!
private var indicatorPresenter: UserIndicatorTypePresenterProtocol!
private var loadingIndicator: UserIndicator?
private var isRoomDirect: Bool = false
private var screenTimer = AnalyticsScreenTimer(screen: .roomDetails)
private var screenTracker = AnalyticsScreenTracker(screen: .roomDetails)
private lazy var closeButton: CloseButton = {
let button = CloseButton()
@@ -137,7 +139,9 @@ final class RoomInfoListViewController: UIViewController {
// Do any additional setup after loading the view.
self.setupViews()
self.activityPresenter = ActivityIndicatorPresenter()
self.indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: self)
self.errorPresenter = MXKErrorAlertPresentation()
self.registerThemeServiceDidChangeThemeNotification()
@@ -152,9 +156,9 @@ final class RoomInfoListViewController: UIViewController {
return self.theme.statusBarStyle
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
screenTimer.start()
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
screenTracker.trackScreen()
}
override func viewDidLayoutSubviews() {
@@ -165,7 +169,7 @@ final class RoomInfoListViewController: UIViewController {
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
screenTimer.stop()
stopLoading()
}
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
@@ -314,16 +318,21 @@ final class RoomInfoListViewController: UIViewController {
}
private func renderLoading() {
self.activityPresenter.presentActivityIndicator(on: self.view, animated: true)
loadingIndicator = indicatorPresenter.present(
.loading(
label: VectorL10n.roomParticipantsLeaveProcessing,
isInteractionBlocking: true
)
)
}
private func renderLoaded(viewData: RoomInfoListViewData) {
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
stopLoading()
self.updateSections(with: viewData)
}
private func render(error: Error) {
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
stopLoading()
self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: nil)
}
@@ -342,6 +351,10 @@ final class RoomInfoListViewController: UIViewController {
return controller
}
private func stopLoading() {
loadingIndicator?.cancel()
}
// MARK: - Actions