Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8c295c6
Make edit items toolbar flexible space not hide shared background
mvasilak Jul 16, 2025
f37c4fb
Ignore appearance in iOS 26
mvasilak Jul 19, 2025
05dd664
Adapt BaseItemsViewController toolbar to iOS 26
mvasilak Jul 19, 2025
3c16a5c
Customize bar button items without appearance
mvasilak Jul 19, 2025
c15fe57
Improve PDFCoordinator
mvasilak Jul 25, 2025
6dd2b2f
Improve CheckboxButton
mvasilak Jul 25, 2025
f209e89
Adapt annotation toolbar button for iOS 26
mvasilak Jul 25, 2025
a0077dc
Customize share extension bar button items without appearance
mvasilak Jul 25, 2025
26ec0e1
Ignore toolbar appearance in iOS 26
mvasilak Jul 26, 2025
f21d3dd
Simplify intra document navigation buttons configuration update
mvasilak Jul 31, 2025
80e777c
Fix ItemsFilterViewController layout in iOS 26
mvasilak Aug 29, 2025
3469689
Refactor settings presentation
mvasilak Aug 29, 2025
4013da4
Improve LibrariesViewController code
mvasilak Aug 30, 2025
75d60ff
Change settings presentation to popover for iOS 26
mvasilak Aug 30, 2025
dcc593a
Change citation bibliography export presentation to popover for iOS 26
mvasilak Aug 31, 2025
467f515
Change single citation presentation to popover for iOS 26
mvasilak Aug 31, 2025
557bfb2
Improve PDF reader settings preferredContentSize for iOS 26
mvasilak Sep 1, 2025
17d3b6d
Make LibrariesViewController UI programmatic
mvasilak Sep 1, 2025
c8255c3
Make LibraryCell UI programmatic
mvasilak Sep 1, 2025
9ae2e9e
Change LibrariesViewController UI design for iOS 26
mvasilak Sep 1, 2025
a4732fe
Fix LibrariesViewController settings button regression
mvasilak Sep 2, 2025
e4199fe
Ignore ShareViewController navigation bar tint color in iOS 26
mvasilak Sep 2, 2025
b3cd13b
Improve Share extension ContainerViewController code
mvasilak Sep 2, 2025
ff2bd79
Make Share extension ContainerViewController horizontal size adaptive
mvasilak Sep 2, 2025
acf34fd
Use system items for done/save & cancel/close buttons in iOS 26
mvasilak Sep 2, 2025
32f379e
Change collection editing presentation to popover for iOS 26
mvasilak Sep 4, 2025
8cd064d
Change item contextual action titles for iOS 26
mvasilak Sep 5, 2025
10e412c
Make MainViewController split view controller not allow sidebar hiding
mvasilak Sep 6, 2025
fc0a07a
Make CollectionCellContentView UI programmatic
mvasilak Sep 6, 2025
96b4e8e
Change Collection cell UI design for iOS 26
mvasilak Sep 6, 2025
5fcfa47
Change Item cell UI design for iOS 26
mvasilak Sep 4, 2025
356e0fe
Change Collection cell indent width for iOS 26
mvasilak Sep 7, 2025
ca31ddd
Fix iOS 26 man view controller expansion
mvasilak Sep 8, 2025
39f70c8
Make collection cell height split layout adaptive in iOS 26
mvasilak Sep 8, 2025
0293f01
Make collection cell separator split layout adaptive in iOS 26
mvasilak Sep 8, 2025
bce7b73
Improve code
mvasilak Sep 8, 2025
2729a40
Fix iOS 26 main view controller expansion
mvasilak Sep 8, 2025
c432c91
Fix iOS 26 focus logic
mvasilak Sep 9, 2025
f902c7d
Make collection cell selection UI split layout adaptive in iOS 26
mvasilak Sep 8, 2025
e195f34
Disable design compatibility for iOS 26
mvasilak Oct 20, 2025
21705ec
Fix crash when searching in items and going to item details and back
mvasilak Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 65 additions & 32 deletions ZShare/View Controllers/ContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,64 +12,97 @@ final class ContainerViewController: UIViewController {
@IBOutlet private weak var containerView: UIView!

private weak var containerHeight: NSLayoutConstraint?
private var constraints: [NSLayoutConstraint] = []
private var didAppear = false

private static let padWidth: CGFloat = 500
private static let regularWidth: CGFloat = 500

override func viewDidLoad() {
super.viewDidLoad()

if UIDevice.current.userInterfaceIdiom == .pad {
self.setupForPad()
} else {
self.setupForPhone()
}
setupLayoutForCurrentTraits()
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.didAppear = true
didAppear = true
}

override func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) {
super.preferredContentSizeDidChange(forChildContentContainer: container)

guard let height = self.containerHeight else { return }
guard let containerHeight else { return }

height.constant = container.preferredContentSize.height
containerHeight.constant = container.preferredContentSize.height

guard self.didAppear else { return }
guard didAppear else { return }

UIView.animate(withDuration: 0.2) {
self.view.layoutIfNeeded()
}
}

private func setupForPad() {
self.view.backgroundColor = ProcessInfo().operatingSystemVersion.majorVersion == 13 ? UIColor.black.withAlphaComponent(0.085) : .clear
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
guard previousTraitCollection?.horizontalSizeClass != traitCollection.horizontalSizeClass else { return }
clearLayout()
setupLayoutForCurrentTraits()

self.containerView.layer.cornerRadius = 8
self.containerView.layer.masksToBounds = true
func clearLayout() {
NSLayoutConstraint.deactivate(constraints)
constraints = []
containerHeight = nil
}
}

let height = self.containerView.heightAnchor.constraint(equalToConstant: 100)
height.priority = .defaultHigh
self.containerHeight = height
private func setupLayoutForCurrentTraits() {
switch traitCollection.horizontalSizeClass {
case .regular:
constraints = setupForHorizontalSizeClassRegular()

NSLayoutConstraint.activate([
self.view.centerXAnchor.constraint(equalTo: self.containerView.centerXAnchor),
self.view.centerYAnchor.constraint(equalTo: self.containerView.centerYAnchor),
self.containerView.heightAnchor.constraint(lessThanOrEqualTo: self.view.heightAnchor),
height,
self.containerView.widthAnchor.constraint(equalToConstant: ContainerViewController.padWidth)
])
}
case .compact:
constraints = setupForHorizontalSizeClassCompact()

case .unspecified:
break

private func setupForPhone() {
NSLayoutConstraint.activate([
self.containerView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
self.containerView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
self.containerView.topAnchor.constraint(equalTo: self.view.topAnchor),
self.containerView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor)
])
@unknown default:
break
}

func setupForHorizontalSizeClassRegular() -> [NSLayoutConstraint] {
view.backgroundColor = .clear

containerView.layer.cornerRadius = 8
containerView.layer.masksToBounds = true

let containerHeight = containerView.heightAnchor.constraint(equalToConstant: 100)
containerHeight.priority = .defaultHigh
self.containerHeight = containerHeight

let constraints = [
containerView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
containerView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
containerView.heightAnchor.constraint(lessThanOrEqualTo: view.heightAnchor),
containerHeight,
containerView.widthAnchor.constraint(equalToConstant: Self.regularWidth)
]
NSLayoutConstraint.activate(constraints)
return constraints
}

func setupForHorizontalSizeClassCompact() -> [NSLayoutConstraint] {
containerView.layer.cornerRadius = 0
containerView.layer.masksToBounds = false

let constraints = [
containerView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
containerView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
containerView.topAnchor.constraint(equalTo: view.topAnchor),
containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
]
NSLayoutConstraint.activate(constraints)
return constraints
}
}
}
35 changes: 26 additions & 9 deletions ZShare/View Controllers/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,7 @@ final class ShareViewController: UIViewController {
self.navigationController?.pushViewController(controller, animated: true)
}

@objc private func done() {
self.viewModel?.submit()
}

@objc private func cancel() {
private func cancel() {
self.viewModel?.cancel()
self.debugLogging.storeLogs { [unowned self] in
self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
Expand Down Expand Up @@ -375,7 +371,12 @@ final class ShareViewController: UIViewController {
switch error {
case .quotaLimit, .webDavFailure, .apiFailure, .forbidden:
self.navigationItem.leftBarButtonItem = nil
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(ShareViewController.cancel))
let cancelAction = UIAction { [weak self] _ in
self?.cancel()
}
let item = UIBarButtonItem(systemItem: .done, primaryAction: cancelAction)
item.tintColor = Asset.Colors.zoteroBlue.color
self.navigationItem.rightBarButtonItem = item
return

default:
Expand Down Expand Up @@ -694,13 +695,29 @@ final class ShareViewController: UIViewController {
}

private func setupNavbar(loggedIn: Bool) {
self.navigationController?.navigationBar.tintColor = Asset.Colors.zoteroBlue.color
if #unavailable(iOS 26.0.0) {
navigationController?.navigationBar.tintColor = Asset.Colors.zoteroBlue.color
}

let cancel = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(ShareViewController.cancel))
let cancelAction = UIAction { [weak self] _ in
self?.cancel()
}
let cancel = UIBarButtonItem(systemItem: .cancel, primaryAction: cancelAction)
self.navigationItem.leftBarButtonItem = cancel

if loggedIn {
let done = UIBarButtonItem(title: L10n.Shareext.save, style: .done, target: self, action: #selector(ShareViewController.done))
let doneAction = UIAction(title: L10n.Shareext.save) { [weak viewModel] _ in
viewModel?.submit()
}
let done: UIBarButtonItem
if #available(iOS 26.0.0, *) {
done = UIBarButtonItem(systemItem: .done, primaryAction: doneAction)
done.tintColor = Asset.Colors.zoteroBlue.color
done.style = .prominent
} else {
done = UIBarButtonItem(primaryAction: doneAction)
done.style = .done
}
done.isEnabled = false
self.navigationItem.rightBarButtonItem = done
}
Expand Down
Loading
Loading