Revert back to UIKit for the presentation of the timeline media preview. (#3719)

* Revert back to UIKit for the presentation of the timeline media preview.

* Fix a presentation issue where the media is clipped until the animation finishes.

* Workaround for the preview controller replacing the info button when swiping.

* Use a self-sizing detent on the media info sheet.
This commit is contained in:
Doug
2025-01-31 17:28:14 +00:00
committed by GitHub
parent ef340fb70f
commit 6cd583d904
25 changed files with 695 additions and 583 deletions
@@ -95,8 +95,9 @@ class MediaEventsTimelineFlowCoordinator: FlowCoordinatorProtocol {
coordinator.actions
.sink { [weak self] action in
switch action {
case .viewItem(let previewContext):
self?.presentMediaPreview(for: previewContext)
case .viewInRoomTimeline(let itemID):
self?.navigationStackCoordinator.pop(animated: false)
self?.actionsSubject.send(.viewInRoomTimeline(itemID))
}
}
.store(in: &cancellables)
@@ -105,27 +106,4 @@ class MediaEventsTimelineFlowCoordinator: FlowCoordinatorProtocol {
self?.actionsSubject.send(.finished)
}
}
private func presentMediaPreview(for previewContext: TimelineMediaPreviewContext) {
let parameters = TimelineMediaPreviewCoordinatorParameters(context: previewContext,
mediaProvider: userSession.mediaProvider,
userIndicatorController: userIndicatorController,
appMediator: appMediator)
let coordinator = TimelineMediaPreviewCoordinator(parameters: parameters)
coordinator.actionsPublisher
.sink { [weak self] action in
switch action {
case .viewInRoomTimeline(let itemID):
self?.navigationStackCoordinator.pop(animated: false)
self?.actionsSubject.send(.viewInRoomTimeline(itemID))
self?.navigationStackCoordinator.setFullScreenCoverCoordinator(nil)
case .dismiss:
self?.navigationStackCoordinator.setFullScreenCoverCoordinator(nil)
}
}
.store(in: &cancellables)
navigationStackCoordinator.setFullScreenCoverCoordinator(coordinator)
}
}