From 0217a37ba8b8bab6c875921eeafb5a97addc8046 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 18 Apr 2024 14:19:59 +0300 Subject: [PATCH] Setup animations for navigation root and split detail and sidebar module changes. --- .../Application/Navigation/NavigationCoordinators.swift | 3 +++ ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift b/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift index 5e5db1b73..0d882b813 100644 --- a/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift +++ b/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift @@ -433,6 +433,8 @@ private struct NavigationSplitCoordinatorView: View { .navigationDestination(for: NavigationModule.self) { module in module.coordinator?.toPresentable() } + .animation(.elementDefault, value: navigationSplitCoordinator.sidebarModule) + .animation(.elementDefault, value: navigationSplitCoordinator.detailModule) } } @@ -721,5 +723,6 @@ private struct NavigationStackCoordinatorView: View { .fullScreenCover(item: $navigationStackCoordinator.fullScreenCoverModule) { module in module.coordinator?.toPresentable() } + .animation(.elementDefault, value: navigationStackCoordinator.rootModule) } } diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 74c1cdeec..6fe0c1b63 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -533,7 +533,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { .store(in: &cancellables) if !isChildFlow { - navigationStackCoordinator.setRootCoordinator(coordinator, animated: animated) { [weak self] in + navigationStackCoordinator.setRootCoordinator(coordinator, animated: false) { [weak self] in self?.stateMachine.tryEvent(.dismissFlow) } } else {