Skip to content

Commit c679eff

Browse files
committed
RSS details liquid glass
1 parent 77b1f55 commit c679eff

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

iTorrent/Screens/Rss/Channel/RssChannelViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ private extension RssChannelViewController {
5252
].compactMap { $0 })
5353

5454
navigationItem.searchController = searchController
55+
navigationItem.preferredSearchBarPlacement = .stacked
5556
navigationItem.trailingItemGroups = [.fixedGroup(items: [actionsButton])]
5657

5758
collectionView.contextMenuConfigurationForItemsAt = { [unowned self] indexPaths, _ in

iTorrent/Screens/Rss/Details/RssDetailsViewController.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import WebKit
1111
import LibTorrent
1212

1313
class RssDetailsViewController<VM: RssDetailsViewModel>: BaseViewController<VM> {
14-
private var webView: WKWebView!
14+
private var webView: WKWebView = .init()
1515
private var webViewViewController: UIViewController!
16-
@IBOutlet private var downloadButtonContainer: UIView!
16+
@IBOutlet private var downloadButtonContainer: UIVisualEffectView!
1717
@IBOutlet private var downloadButtonNonSafeAreaHolder: UIView!
18+
@IBOutlet private var downloadButtonSeparator: UIView!
1819
@IBOutlet private var downloadButton: UIButton!
1920
@IBOutlet private var separatorHeight: NSLayoutConstraint!
2021

@@ -65,7 +66,14 @@ private extension RssDetailsViewController {
6566
separatorHeight.constant = 1 / traitCollection.displayScale
6667

6768
if #available(iOS 26, visionOS 26, *) {
69+
downloadButtonContainer.effect = nil
70+
downloadButtonSeparator.isHidden = true
6871
downloadButton.configuration = .prominentGlass()
72+
73+
let interaction = UIScrollEdgeElementContainerInteraction()
74+
interaction.scrollView = webView.scrollView
75+
interaction.edge = .bottom
76+
downloadButtonContainer.addInteraction(interaction)
6977
}
7078

7179
downloadButton.configuration?.titleTextAttributesTransformer = .init { attributes in
@@ -86,7 +94,6 @@ private extension RssDetailsViewController {
8694
navigationItem.setRightBarButton(button, animated: false)
8795
}
8896

89-
webView = WKWebView()
9097
webView.translatesAutoresizingMaskIntoConstraints = false
9198
webView.scrollView.backgroundColor = .systemBackground
9299
webView.isOpaque = false
@@ -111,7 +118,7 @@ private extension RssDetailsViewController {
111118
webViewViewController.additionalSafeAreaInsets.left = 8
112119
webViewViewController.additionalSafeAreaInsets.right = 8
113120

114-
webView.backgroundColor = .secondarySystemBackground
121+
webView.backgroundColor = .systemBackground
115122
#if !os(visionOS)
116123
webView.scrollView.keyboardDismissMode = .onDrag
117124
#endif

iTorrent/Screens/Rss/Details/RssDetailsViewController.xib

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24127" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_12" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24053.1"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24063"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="System colors in document resources" minToolsVersion="11.0"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -14,6 +14,7 @@
1414
<outlet property="downloadButton" destination="R8S-tB-1b4" id="3yu-mH-nJO"/>
1515
<outlet property="downloadButtonContainer" destination="xCD-YA-oKB" id="eK2-im-klj"/>
1616
<outlet property="downloadButtonNonSafeAreaHolder" destination="3Ps-Uv-dSz" id="MiX-Rx-lab"/>
17+
<outlet property="downloadButtonSeparator" destination="o8f-Qi-dG1" id="2Uh-8Z-Qjc"/>
1718
<outlet property="separatorHeight" destination="2Zc-oS-FFr" id="di2-Ep-Sgk"/>
1819
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
1920
</connections>

0 commit comments

Comments
 (0)