mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
Rename properties and arguments
This commit is contained in:
@@ -19,11 +19,11 @@ import XCTest
|
||||
|
||||
class UserIndicatorQueueTests: XCTestCase {
|
||||
var indicators: [UserIndicator]!
|
||||
var center: UserIndicatorQueue!
|
||||
var queue: UserIndicatorQueue!
|
||||
|
||||
override func setUp() {
|
||||
indicators = []
|
||||
center = UserIndicatorQueue()
|
||||
queue = UserIndicatorQueue()
|
||||
}
|
||||
|
||||
func makeRequest() -> UserIndicatorRequest {
|
||||
@@ -34,19 +34,19 @@ class UserIndicatorQueueTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testStartsIndicatorWhenAdded() {
|
||||
let indicator = center.add(makeRequest())
|
||||
let indicator = queue.add(makeRequest())
|
||||
XCTAssertEqual(indicator.state, .executing)
|
||||
}
|
||||
|
||||
func testSecondIndicatorIsPending() {
|
||||
center.add(makeRequest()).store(in: &indicators)
|
||||
let indicator = center.add(makeRequest())
|
||||
queue.add(makeRequest()).store(in: &indicators)
|
||||
let indicator = queue.add(makeRequest())
|
||||
XCTAssertEqual(indicator.state, .pending)
|
||||
}
|
||||
|
||||
func testSecondIndicatorIsExecutingWhenFirstCompleted() {
|
||||
let first = center.add(makeRequest())
|
||||
let second = center.add(makeRequest())
|
||||
let first = queue.add(makeRequest())
|
||||
let second = queue.add(makeRequest())
|
||||
|
||||
first.cancel()
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ final class BuildSettings: NSObject {
|
||||
static let allowInviteExernalUsers: Bool = true
|
||||
|
||||
/// Whether a screen uses legacy local activity indicators or improved app-wide indicators
|
||||
static var appActivityIndicators: Bool {
|
||||
static var useAppUserIndicators: Bool {
|
||||
#if DEBUG
|
||||
return true
|
||||
#else
|
||||
|
||||
@@ -29,18 +29,18 @@ import UIKit
|
||||
private weak var viewController: UIViewController?
|
||||
private var indicator: UserIndicator?
|
||||
|
||||
init(label: String, on viewController: UIViewController) {
|
||||
init(label: String, viewController: UIViewController) {
|
||||
self.label = label
|
||||
self.viewController = viewController
|
||||
}
|
||||
|
||||
func presentActivityIndicator(on view: UIView, animated: Bool, completion: (() -> Void)?) {
|
||||
guard let vc = viewController else {
|
||||
guard let viewController = viewController else {
|
||||
return
|
||||
}
|
||||
|
||||
let request = UserIndicatorRequest(
|
||||
presenter: FullscreenLoadingIndicatorPresenter(label: label, on: vc),
|
||||
presenter: FullscreenLoadingIndicatorPresenter(label: label, viewController: viewController),
|
||||
dismissal: .manual
|
||||
)
|
||||
|
||||
|
||||
@@ -25,18 +25,18 @@ class FullscreenLoadingIndicatorPresenter: UserIndicatorPresentable {
|
||||
private weak var viewController: UIViewController?
|
||||
private weak var view: UIView?
|
||||
|
||||
init(label: String, on viewController: UIViewController) {
|
||||
init(label: String, viewController: UIViewController) {
|
||||
self.label = label
|
||||
self.viewController = viewController
|
||||
}
|
||||
|
||||
func present() {
|
||||
// Find the current top navigation controller
|
||||
var vc: UIViewController? = viewController
|
||||
while vc?.navigationController != nil {
|
||||
vc = vc?.navigationController
|
||||
var presentingController: UIViewController? = viewController
|
||||
while presentingController?.navigationController != nil {
|
||||
presentingController = presentingController?.navigationController
|
||||
}
|
||||
guard let presentingVC = vc else {
|
||||
guard let presentingController = presentingController else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ class FullscreenLoadingIndicatorPresenter: UserIndicatorPresentable {
|
||||
self.view = view
|
||||
|
||||
view.translatesAutoresizingMaskIntoConstraints = false
|
||||
presentingVC.view.addSubview(view)
|
||||
presentingController.view.addSubview(view)
|
||||
NSLayoutConstraint.activate([
|
||||
view.topAnchor.constraint(equalTo: presentingVC.view.topAnchor),
|
||||
view.bottomAnchor.constraint(equalTo: presentingVC.view.bottomAnchor),
|
||||
view.leadingAnchor.constraint(equalTo: presentingVC.view.leadingAnchor),
|
||||
view.trailingAnchor.constraint(equalTo: presentingVC.view.trailingAnchor)
|
||||
view.topAnchor.constraint(equalTo: presentingController.view.topAnchor),
|
||||
view.bottomAnchor.constraint(equalTo: presentingController.view.bottomAnchor),
|
||||
view.leadingAnchor.constraint(equalTo: presentingController.view.leadingAnchor),
|
||||
view.trailingAnchor.constraint(equalTo: presentingController.view.trailingAnchor)
|
||||
])
|
||||
|
||||
view.alpha = 0
|
||||
|
||||
@@ -116,10 +116,10 @@ final class RoomInfoListViewController: UIViewController {
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
self.setupViews()
|
||||
if BuildSettings.appActivityIndicators {
|
||||
if BuildSettings.useAppUserIndicators {
|
||||
self.activityPresenter = FullscreenActivityIndicatorPresenter(
|
||||
label: VectorL10n.roomParticipantsLeaveProcessing,
|
||||
on: self
|
||||
viewController: self
|
||||
)
|
||||
} else {
|
||||
self.activityPresenter = ActivityIndicatorPresenter()
|
||||
|
||||
@@ -76,10 +76,6 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType {
|
||||
self.activityIndicatorPresenter = ActivityIndicatorPresenter()
|
||||
}
|
||||
|
||||
deinit {
|
||||
indicators.cancelAll()
|
||||
}
|
||||
|
||||
// MARK: - Public methods
|
||||
|
||||
func start() {
|
||||
@@ -234,7 +230,7 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType {
|
||||
homeViewController.tabBarItem.image = homeViewController.tabBarItem.image
|
||||
homeViewController.accessibilityLabel = VectorL10n.titleHome
|
||||
|
||||
if BuildSettings.appActivityIndicators {
|
||||
if BuildSettings.useAppUserIndicators {
|
||||
homeViewController.userIndicatorPresenter = AppUserIndicatorPresenter(appNavigator: parameters.appNavigator)
|
||||
}
|
||||
|
||||
@@ -709,7 +705,7 @@ extension TabBarCoordinator: RoomCoordinatorDelegate {
|
||||
func roomCoordinatorDidLeaveRoom(_ coordinator: RoomCoordinatorProtocol) {
|
||||
// For the moment when a room is left, reset the split detail with placeholder
|
||||
self.resetSplitViewDetails()
|
||||
if BuildSettings.appActivityIndicators {
|
||||
if BuildSettings.useAppUserIndicators {
|
||||
parameters.appNavigator
|
||||
.addUserIndicator(.success(VectorL10n.roomParticipantsLeaveSuccess))
|
||||
.store(in: &indicators)
|
||||
|
||||
Reference in New Issue
Block a user