generated from element-hq/.github
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework the presentation of the media browser quick look view to use S…
…wiftUI. (#3619) * Embed the media preview quick look inside a full screen cover With a zoom transition on iOS 18. * Use a the representable coordinator properly. * Fix a bug with the toolbar appearance. * Format * Try prevent the zoom transition being upside down. * Fix the snapshot test configuration.
- Loading branch information
Showing
23 changed files
with
593 additions
and
473 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
ElementX/Sources/Other/SwiftUI/Animation/ZoomTransition.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright 2024 New Vector Ltd. | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
// Please see LICENSE in the repository root for full details. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension View { | ||
/// A convenience modifier to conditionally apply `.navigationTransition(.zoom(…))` when available. | ||
@ViewBuilder | ||
func zoomTransition(sourceID: some Hashable, in namespace: Namespace.ID) -> some View { | ||
if #available(iOS 18.0, *) { | ||
navigationTransition(.zoom(sourceID: sourceID, in: namespace)) | ||
} else { | ||
self | ||
} | ||
} | ||
|
||
/// A convenience modifier to conditionally apply `.matchedTransitionSource(…)` when available. | ||
@ViewBuilder | ||
func zoomTransitionSource(id: some Hashable, in namespace: Namespace.ID) -> some View { | ||
if #available(iOS 18.0, *) { | ||
matchedTransitionSource(id: id, in: namespace) | ||
} else { | ||
self | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Copyright 2024 New Vector Ltd. | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
// Please see LICENSE in the repository root for full details. | ||
// | ||
|
||
import SwiftUI | ||
|
||
/// A view that renders a `UIBlurEffect` as there is a larger range of | ||
/// effects available compared to using SwiftUI's `Material` type. | ||
struct BlurEffectView: UIViewRepresentable { | ||
var style: UIBlurEffect.Style | ||
|
||
func makeUIView(context: Context) -> UIVisualEffectView { | ||
UIVisualEffectView(effect: UIBlurEffect(style: style)) | ||
} | ||
|
||
func updateUIView(_ uiView: UIVisualEffectView, context: Context) { | ||
uiView.effect = UIBlurEffect(style: style) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
ElementX/Sources/Screens/FilePreviewScreen/MediaFileManager.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// Copyright 2024 New Vector Ltd. | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
// Please see LICENSE in the repository root for full details. | ||
// | ||
|
||
import Foundation |
180 changes: 0 additions & 180 deletions
180
ElementX/Sources/Screens/FilePreviewScreen/TimelineMediaPreviewController.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.