Update activity indicators on leaving room

Signed-off-by: Andy Uhnak <andyuhnak@gmail.com>
This commit is contained in:
Andy Uhnak
2022-02-17 11:10:55 +00:00
parent 1904bd494c
commit 9eae7c02bb
18 changed files with 437 additions and 84 deletions
+11 -2
View File
@@ -17,6 +17,15 @@
import Foundation
import CommonKit
/// Type of activity to be shown in the app navigator
enum AppActivityType {
/// Loading toast with custom label
case loading(String)
/// Success toast with custom label
case success(String)
}
/// AppNavigatorProtocol abstract a navigator at app level.
/// It enables to perform the navigation within the global app scope (open the side menu, open a room and so on)
/// Note: Presentation of the pattern here https://www.swiftbysundell.com/articles/navigation-in-swift/#where-to-navigator
@@ -28,11 +37,11 @@ protocol AppNavigatorProtocol {
/// Do not use protocol with associatedtype for the moment like presented here https://www.swiftbysundell.com/articles/navigation-in-swift/#where-to-navigator use a separate enum
func navigate(to destination: AppNavigatorDestination)
/// Add loading activity to an app-wide queue of other activitie
/// Add new activity, such as loading indicator or a success message, to an app-wide queue of other activities
///
/// If the queue is empty, the activity will be displayed immediately, otherwise it will be pending
/// until the previously added activities have completed / been cancelled.
///
/// To remove an activity indicator, cancel or deallocate the returned `Activity`
func addLoadingActivity() -> Activity
func addAppActivity(_ type: AppActivityType) -> Activity
}