Skip to content

Commit ff930aa

Browse files
authored
Integrate zoom transitions in Theme browser (#23945)
2 parents fcc9cf5 + babc529 commit ff930aa

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* [*] Fix an issue with comments being lost on request failure [#23942]
1515
* [*] Fix an issue with Referrers in Stats showing invalid icons [#23943]
1616
* [*] Update site menu style on iPhone [#23944]
17+
* [*] Integrate zoom transitions in Themes [#23945]
1718

1819

1920
25.6

WordPress/Classes/ViewRelated/Themes/ThemeBrowserViewController.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,13 @@ public protocol ThemePresenter: AnyObject {
850850
presentUrlForTheme(theme, url: theme?.viewUrl(), onClose: onWebkitViewControllerClose)
851851
}
852852

853-
@objc open func presentUrlForTheme(_ theme: Theme?, url: String?, activeButton: Bool = true, modalStyle: UIModalPresentationStyle = .pageSheet, onClose: (() -> Void)? = nil) {
853+
@objc open func presentUrlForTheme(
854+
_ theme: Theme?,
855+
url: String?,
856+
activeButton: Bool = true,
857+
modalStyle: UIModalPresentationStyle = .pageSheet,
858+
onClose: (() -> Void)? = nil
859+
) {
854860
guard let theme, let url = url.flatMap(URL.init(string:)) else {
855861
return
856862
}
@@ -870,8 +876,14 @@ public protocol ThemePresenter: AnyObject {
870876

871877
let webViewController = WebViewControllerFactory.controller(configuration: configuration, source: "theme_browser")
872878
webViewController.navigationItem.rightBarButtonItem = activateButton
879+
873880
let navigation = UINavigationController(rootViewController: webViewController)
874881
navigation.modalPresentationStyle = modalStyle
882+
if #available(iOS 18, *), let indexPath = collectionView.indexPathsForSelectedItems?.first {
883+
navigation.preferredTransition = .zoom(sourceViewProvider: { [weak self] _ in
884+
self?.collectionView.cellForItem(at: indexPath)?.contentView
885+
})
886+
}
875887

876888
if searchController != nil && searchController.isActive {
877889
searchController.dismiss(animated: true, completion: {

0 commit comments

Comments
 (0)