Compare commits

...
Author SHA1 Message Date
Marino Faggiana fd2328c693 feat: poll visible folders for server changes
Check folder ETags every 30 seconds and refresh when they change. Stop polling when leaving the view or entering the background, and skip checks during user interaction or active refreshes.

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-22 11:41:13 +02:00
Marino Faggiana faf9617904 fix: unify navigation overflow and organize file action menus (#4412)
* refactor: use native navigation overflow menus

Move screen options into UIKit's shared overflow menu, guard asynchronous updates against navigation changes, and expose the media date picker as an overflow action.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: add view in folder to media and recommendation menus

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: group context menu actions into consistent sections

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump version to 35.2.1 and reset build number to 0

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-22 09:45:52 +02:00
Marino Faggiana 869ffa6a23 closed version
Signed-off-by: Marino Faggiana <[email protected]>
2026-10-21 09:00:56 +02:00
Nextcloud bot b1672c9c81 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-21 03:27:21 +00:00
Marino Faggiana 0b9c7598fa fix: use consistent 20-point spacing for the add button
Bump the build number to 2.

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-20 15:52:14 +02:00
Marino Faggiana a2d8a5d4e5 fix: adapt layouts and image rendering to the available window (#4409)
* fix: adapt collection layouts to available view dimensions

Calculate maximum columns and rich workspace header height from collection view bounds, ensuring at least one column. Refresh the header height constraint when updating the layout.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: size popups and context menu previews within safe areas

Use source view bounds for preview sizing and constrain popups to available safe areas. Update keyboard positioning as its frame and the popup layout change.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: use view-specific display scales for image rendering

Replace UIScreen.main dependencies with trait and environment display scales. Modernize link avatar rendering and size folder icons independently of screen bounds.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: use static thumbnails for context menu media previews

Remove video, audio and Live Photo playback and related downloads. Prefer the supplied thumbnail and limit transfer updates to the previewed image.

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-20 15:23:27 +02:00
Marino Faggiana 216746ae6e fix: load older filtered media and keep navigation bars visible (#4407)
* fix: load older filtered media and keep navigation bars visible

Continue fetching images and videos together while a media filter is active, and skip deletion checks for partial history pages. Keep navigation controls visible while scrolling on iOS 27.

Assisted-by: Codex:GPT-6
Signed-off-by: Marino Faggiana <[email protected]>

* fix: keep activity navigation visible while scrolling

Assisted-by: Codex:GPT-6
Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 1

Signed-off-by: Marino Faggiana <[email protected]>

* fix: keep transfers navigation visible while scrolling

Assisted-by: Codex:GPT-6
Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-20 10:10:36 +02:00
Nextcloud bot f3bcf3040d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-19 03:37:10 +00:00
Nextcloud bot 47e46f3afa fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-17 03:41:07 +00:00
Marino Faggiana 841d44ea08 feat: enable adaptive media viewer and improve navigation consistency (#4403)
* feat: enable adaptive media layout and remove filename logo

Signed-off-by: Marino Faggiana <[email protected]>

* fix: unify navigation loading indicators and preserve Browse state

Show loading indicators in the navigation bar for files, albums and trash while keeping cached albums visible during refresh.

Preserve the sidebar destination, personal filter and folder stack when switching tabs.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: keep sidebar notification badge within bounds before iOS 26

Signed-off-by: Marino Faggiana <[email protected]>

* fix: use opaque media date picker background before iOS 26

Signed-off-by: Marino Faggiana <[email protected]>

* fix: refresh search navigation layout on iOS versions before 26

Signed-off-by: Marino Faggiana <[email protected]>

* fix: use waveform icon for video audio track menus

Signed-off-by: Marino Faggiana <[email protected]>

* fix: allow media viewer filenames to span two lines

Signed-off-by: Marino Faggiana <[email protected]>

* build 3

Signed-off-by: Marino Faggiana <[email protected]>

* new version

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-16 16:10:25 +02:00
Nextcloud bot c00dd78508 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-16 03:40:00 +00:00
Marino Faggiana 09b30d4126 [fix] Improved files scroll (#4400)
* fix: defer cell context menu creation until opening

Validate the cell's current metadata before creating menu actions to handle cell reuse safely. Clear the menu when metadata is unavailable.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: reuse favorite outline view in list cells

Keep a single outline view and its constraints across cell reuse, updating visibility instead of adding duplicate subviews.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-15 15:50:10 +02:00
Marino Faggiana 43f57df908 fix: keep whole-library auto-upload discovery unfiltered (#4399)
* fix: keep whole-library auto-upload discovery unfiltered

Share date filtering between app and extension, ignoring upload progress in whole-library mode. Clear the previous date when selecting the whole library and add regression tests.

Signed-off-by: Marino Faggiana <[email protected]>

* test: stabilize media viewer layout assertions

Account for pixel rounding in image centering and constrain video controls within a fixed test container.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-15 11:24:19 +02:00
Nextcloud bot 87c0cd23e1 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-15 04:05:03 +00:00
Nextcloud bot ee54ca3e47 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-14 14:33:46 +00:00
Marino Faggiana d5f40266cc fix: track photo library assets for manual uploads (#4396)
* fix test

Signed-off-by: Marino Faggiana <[email protected]>

* fix: track photo library assets for manual uploads

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-10-14 16:10:23 +02:00
Nextcloud bot 7583433c84 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-14 14:09:40 +00:00
Nextcloud bot cd6956d249 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-14 10:23:56 +00:00
Marino Faggiana b7853ed4b0 feat: add experimental adaptive media viewer
Add independent adaptive controls for images, audio, AVPlayer and VLC while
keeping the experiment disabled for normal-mode TestFlight regression checks.
Include shared playback progress styling, information fixes, viewer tests
and the required project resources.

Assisted-by: Codex:GPT-6
Signed-off-by: Marino Faggiana <[email protected]>
2026-10-14 12:05:11 +02:00
200 changed files with 4925 additions and 3765 deletions

No files matched your search

@@ -35,10 +35,8 @@ extension BackgroundUploadExtension {
var predicates: [NSPredicate] = [NSCompoundPredicate(orPredicateWithSubpredicates: mediaPredicates)]
let discoveryStartDate = account.autoUploadSinceDate
if let discoveryStartDate {
predicates.append(NSPredicate(format: "creationDate >= %@", discoveryStartDate as NSDate))
if let datePredicate = account.autoUploadDatePredicate {
predicates.append(datePredicate)
}
fetchOptions.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: predicates)
+296 -240
View File
@@ -70,6 +70,9 @@
AB7000022F70000100FE2776 /* NCShareDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7000012F70000100FE2776 /* NCShareDetailsView.swift */; };
AB7000042F70000100FE2776 /* NCShareDetailsGovernanceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7000032F70000100FE2776 /* NCShareDetailsGovernanceModel.swift */; };
AB7000062F70000100FE2776 /* NCGovernanceLabelSelectorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7000052F70000100FE2776 /* NCGovernanceLabelSelectorView.swift */; };
AC13ADAF2026101300000002 /* NCMediaAdaptiveLayoutViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC13ADAF2026101300000001 /* NCMediaAdaptiveLayoutViewTests.swift */; };
AC14ADAF2026101400000002 /* NCMediaAdaptiveControlsLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC14ADAF2026101400000001 /* NCMediaAdaptiveControlsLayout.swift */; };
AC14ADAF2026101400000012 /* NCMediaViewerPreviewLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC14ADAF2026101400000011 /* NCMediaViewerPreviewLoader.swift */; };
AF1A9B6427D0CA1E00F17A9E /* UIAlertController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */; };
AF1A9B6527D0CC0500F17A9E /* UIAlertController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */; };
AF22B206277B4E4C00DAB0CC /* NCCreateFormUploadConflict.swift in Sources */ = {isa = PBXBuildFile; fileRef = F704B5E42430AA8000632F5F /* NCCreateFormUploadConflict.swift */; };
@@ -444,6 +447,49 @@
F7501C332212E57500FB1415 /* NCMedia.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7501C312212E57400FB1415 /* NCMedia.swift */; };
F751247C2C42919C00E63DB8 /* NCPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F751247A2C42919C00E63DB8 /* NCPhotoCell.swift */; };
F751247E2C42919C00E63DB8 /* NCPhotoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F751247B2C42919C00E63DB8 /* NCPhotoCell.xib */; };
F75175E0307F52E60057C9B0 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = F75175DE307F52E60057C9B0 /* README.md */; };
F75175E1307F52E60057C9B0 /* NCMediaViewerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175CA307F52E60057C9B0 /* NCMediaViewerView.swift */; };
F75175E2307F52E60057C9B0 /* NCMediaViewerHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175DB307F52E60057C9B0 /* NCMediaViewerHostingController.swift */; };
F75175E3307F52E60057C9B0 /* NCImageAdaptiveControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175AB307F52E60057C9B0 /* NCImageAdaptiveControlsView.swift */; };
F75175E4307F52E60057C9B0 /* NCMediaPlaybackOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C7307F52E60057C9B0 /* NCMediaPlaybackOptions.swift */; };
F75175E5307F52E60057C9B0 /* NCVideoVLCViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175BE307F52E60057C9B0 /* NCVideoVLCViewController.swift */; };
F75175E6307F52E60057C9B0 /* NCVideoPlaybackPresentationContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175CB307F52E60057C9B0 /* NCVideoPlaybackPresentationContext.swift */; };
F75175E7307F52E60057C9B0 /* NCVideoViewerContentView+VLC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175BC307F52E60057C9B0 /* NCVideoViewerContentView+VLC.swift */; };
F75175E8307F52E60057C9B0 /* NCVideoAVPlayerViewControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B8307F52E60057C9B0 /* NCVideoAVPlayerViewControls.swift */; };
F75175E9307F52E60057C9B0 /* NCMediaViewerPagingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D8307F52E60057C9B0 /* NCMediaViewerPagingView.swift */; };
F75175EA307F52E60057C9B0 /* NCMediaAdaptivePagingFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D2307F52E60057C9B0 /* NCMediaAdaptivePagingFooterView.swift */; };
F75175EB307F52E60057C9B0 /* NCImageControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175AC307F52E60057C9B0 /* NCImageControlsView.swift */; };
F75175EC307F52E60057C9B0 /* NCMediaViewerTransitionSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175CE307F52E60057C9B0 /* NCMediaViewerTransitionSource.swift */; };
F75175ED307F52E60057C9B0 /* NCVideoAdaptivePlaybackCoverControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B7307F52E60057C9B0 /* NCVideoAdaptivePlaybackCoverControlsView.swift */; };
F75175EE307F52E60057C9B0 /* NCMediaAdaptiveControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D1307F52E60057C9B0 /* NCMediaAdaptiveControlsView.swift */; };
F75175EF307F52E60057C9B0 /* NCMediaViewerPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175DC307F52E60057C9B0 /* NCMediaViewerPresenter.swift */; };
F75175F0307F52E60057C9B0 /* NCMediaViewerFloatingTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D6307F52E60057C9B0 /* NCMediaViewerFloatingTitleView.swift */; };
F75175F1307F52E60057C9B0 /* NCVideoVLCViewControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175BA307F52E60057C9B0 /* NCVideoVLCViewControls.swift */; };
F75175F2307F52E60057C9B0 /* NCMediaViewerThumbnail.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D9307F52E60057C9B0 /* NCMediaViewerThumbnail.swift */; };
F75175F3307F52E60057C9B0 /* NCLivePhotoViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B0307F52E60057C9B0 /* NCLivePhotoViewerContentView.swift */; };
F75175F4307F52E60057C9B0 /* NCAudioAdaptiveControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175A7307F52E60057C9B0 /* NCAudioAdaptiveControlsView.swift */; };
F75175F5307F52E60057C9B0 /* NCMediaViewerLoadingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C8307F52E60057C9B0 /* NCMediaViewerLoadingPolicy.swift */; };
F75175F6307F52E60057C9B0 /* NCVideoAdaptiveControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B6307F52E60057C9B0 /* NCVideoAdaptiveControlsView.swift */; };
F75175F7307F52E60057C9B0 /* NCMediaViewerPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D7307F52E60057C9B0 /* NCMediaViewerPageView.swift */; };
F75175F8307F52E60057C9B0 /* NCImageZoomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175AF307F52E60057C9B0 /* NCImageZoomView.swift */; };
F75175F9307F52E60057C9B0 /* Notification+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175CF307F52E60057C9B0 /* Notification+Extension.swift */; };
F75175FA307F52E60057C9B0 /* NCAudioViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175A9307F52E60057C9B0 /* NCAudioViewerContentView.swift */; };
F75175FB307F52E60057C9B0 /* NCVideoViewerContentView+AVPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B4307F52E60057C9B0 /* NCVideoViewerContentView+AVPlayer.swift */; };
F75175FC307F52E60057C9B0 /* NCVideoAVPlayerPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B2307F52E60057C9B0 /* NCVideoAVPlayerPresenter.swift */; };
F75175FD307F52E60057C9B0 /* NCVideoPlaybackCoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C2307F52E60057C9B0 /* NCVideoPlaybackCoverView.swift */; };
F75175FE307F52E60057C9B0 /* NCVideoPlaybackController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C1307F52E60057C9B0 /* NCVideoPlaybackController.swift */; };
F75175FF307F52E60057C9B0 /* NCVideoControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B9307F52E60057C9B0 /* NCVideoControlsView.swift */; };
F7517600307F52E60057C9B0 /* NCVideoURLResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C3307F52E60057C9B0 /* NCVideoURLResolver.swift */; };
F7517601307F52E60057C9B0 /* NCVideoViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C4307F52E60057C9B0 /* NCVideoViewerContentView.swift */; };
F7517602307F52E60057C9B0 /* NCVideoVLCPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175BD307F52E60057C9B0 /* NCVideoVLCPresenter.swift */; };
F7517603307F52E60057C9B0 /* NCMediaViewerDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D5307F52E60057C9B0 /* NCMediaViewerDetailView.swift */; };
F7517604307F52E60057C9B0 /* NCNextcloudMediaViewerLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175DD307F52E60057C9B0 /* NCNextcloudMediaViewerLoader.swift */; };
F7517605307F52E60057C9B0 /* NCMediaViewerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175C9307F52E60057C9B0 /* NCMediaViewerModel.swift */; };
F7517606307F52E60057C9B0 /* NCVideoAVPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175B3307F52E60057C9B0 /* NCVideoAVPlayerViewController.swift */; };
F7517608307F52E60057C9B0 /* NCMediaViewerAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175CD307F52E60057C9B0 /* NCMediaViewerAppearance.swift */; };
F7517609307F52E60057C9B0 /* NCMediaAdaptiveLayoutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175D4307F52E60057C9B0 /* NCMediaAdaptiveLayoutView.swift */; };
F751760A307F52E60057C9B0 /* NCImageViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175AE307F52E60057C9B0 /* NCImageViewerContentView.swift */; };
F751760B307F53680057C9B0 /* NCMediaViewerTransitionSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75175CE307F52E60057C9B0 /* NCMediaViewerTransitionSource.swift */; };
F752BA052E58C05200616A26 /* Maintenance.swift in Sources */ = {isa = PBXBuildFile; fileRef = F752BA042E58C05200616A26 /* Maintenance.swift */; };
F753BA93281FD8020015BFB6 /* EasyTipView in Frameworks */ = {isa = PBXBuildFile; productRef = F753BA92281FD8020015BFB6 /* EasyTipView */; };
F755BD9B20594AC7008C5FBB /* NCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F755BD9A20594AC7008C5FBB /* NCService.swift */; };
@@ -484,42 +530,6 @@
F75A644B307DFA2C0059B78E /* AlbumsGridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6425307DFA2C0059B78E /* AlbumsGridView.swift */; };
F75A644C307DFA2C0059B78E /* AddToAlbumsListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6423307DFA2C0059B78E /* AddToAlbumsListView.swift */; };
F75A644D307DFA2C0059B78E /* NCAlbums.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F75A6432307DFA2C0059B78E /* NCAlbums.storyboard */; };
F75A647D307DFA6B0059B78E /* NCImageZoomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6451307DFA6B0059B78E /* NCImageZoomView.swift */; };
F75A647E307DFA6B0059B78E /* NCMediaViewerThumbnail.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6478307DFA6B0059B78E /* NCMediaViewerThumbnail.swift */; };
F75A647F307DFA6B0059B78E /* NCMediaViewerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A646B307DFA6B0059B78E /* NCMediaViewerView.swift */; };
F75A6480307DFA6B0059B78E /* NCMediaViewerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A646A307DFA6B0059B78E /* NCMediaViewerModel.swift */; };
F75A6481307DFA6B0059B78E /* NCAudioViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A644E307DFA6B0059B78E /* NCAudioViewerContentView.swift */; };
F75A6482307DFA6B0059B78E /* NCVideoViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6465307DFA6B0059B78E /* NCVideoViewerContentView.swift */; };
F75A6483307DFA6B0059B78E /* NCVideoURLResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6464307DFA6B0059B78E /* NCVideoURLResolver.swift */; };
F75A6484307DFA6B0059B78E /* NCVideoVLCViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A645F307DFA6B0059B78E /* NCVideoVLCViewController.swift */; };
F75A6485307DFA6B0059B78E /* NCLivePhotoViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6452307DFA6B0059B78E /* NCLivePhotoViewerContentView.swift */; };
F75A6486307DFA6B0059B78E /* NCVideoAVPlayerPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6454307DFA6B0059B78E /* NCVideoAVPlayerPresenter.swift */; };
F75A6487307DFA6B0059B78E /* NCVideoViewerContentView+VLC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A645D307DFA6B0059B78E /* NCVideoViewerContentView+VLC.swift */; };
F75A6488307DFA6B0059B78E /* NCMediaViewerPagingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6477307DFA6B0059B78E /* NCMediaViewerPagingView.swift */; };
F75A6489307DFA6B0059B78E /* NCVideoVLCPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A645E307DFA6B0059B78E /* NCVideoVLCPresenter.swift */; };
F75A648A307DFA6B0059B78E /* NCVideoAVPlayerViewControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6459307DFA6B0059B78E /* NCVideoAVPlayerViewControls.swift */; };
F75A648B307DFA6B0059B78E /* NCVideoPlaybackCoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6463307DFA6B0059B78E /* NCVideoPlaybackCoverView.swift */; };
F75A648C307DFA6B0059B78E /* Notification+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6470307DFA6B0059B78E /* Notification+Extension.swift */; };
F75A648D307DFA6B0059B78E /* NCVideoAdaptiveLayoutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6461307DFA6B0059B78E /* NCVideoAdaptiveLayoutView.swift */; };
F75A648E307DFA6B0059B78E /* NCVideoVLCViewControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A645B307DFA6B0059B78E /* NCVideoVLCViewControls.swift */; };
F75A648F307DFA6B0059B78E /* NCMediaViewerPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6476307DFA6B0059B78E /* NCMediaViewerPageView.swift */; };
F75A6490307DFA6B0059B78E /* NCVideoViewerContentView+AVPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6456307DFA6B0059B78E /* NCVideoViewerContentView+AVPlayer.swift */; };
F75A6491307DFA6B0059B78E /* NCVideoPlaybackController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6462307DFA6B0059B78E /* NCVideoPlaybackController.swift */; };
F75A6492307DFA6B0059B78E /* NCImageViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6450307DFA6B0059B78E /* NCImageViewerContentView.swift */; };
F75A6493307DFA6B0059B78E /* NCMediaViewerPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A647B307DFA6B0059B78E /* NCMediaViewerPresenter.swift */; };
F75A6494307DFA6B0059B78E /* NCMediaPlaybackOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6468307DFA6B0059B78E /* NCMediaPlaybackOptions.swift */; };
F75A6495307DFA6B0059B78E /* NCMediaViewerDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6474307DFA6B0059B78E /* NCMediaViewerDetailView.swift */; };
F75A6496307DFA6B0059B78E /* NCMediaViewerFloatingTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6475307DFA6B0059B78E /* NCMediaViewerFloatingTitleView.swift */; };
F75A6497307DFA6B0059B78E /* NCVideoAdaptiveControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6458307DFA6B0059B78E /* NCVideoAdaptiveControlsView.swift */; };
F75A6498307DFA6B0059B78E /* NCVideoPlaybackPresentationContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A646C307DFA6B0059B78E /* NCVideoPlaybackPresentationContext.swift */; };
F75A6499307DFA6B0059B78E /* NCMediaViewerTransitionSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A646F307DFA6B0059B78E /* NCMediaViewerTransitionSource.swift */; };
F75A649A307DFA6B0059B78E /* NCMediaViewerAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A646E307DFA6B0059B78E /* NCMediaViewerAppearance.swift */; };
F75A649B307DFA6B0059B78E /* NCNextcloudMediaViewerLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6472307DFA6B0059B78E /* NCNextcloudMediaViewerLoader.swift */; };
F75A649C307DFA6B0059B78E /* NCVideoAVPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6455307DFA6B0059B78E /* NCVideoAVPlayerViewController.swift */; };
F75A649D307DFA6B0059B78E /* NCMediaViewerLoadingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A6469307DFA6B0059B78E /* NCMediaViewerLoadingPolicy.swift */; };
F75A649E307DFA6B0059B78E /* NCVideoControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A645A307DFA6B0059B78E /* NCVideoControlsView.swift */; };
F75A649F307DFA6B0059B78E /* NCMediaViewerHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A647A307DFA6B0059B78E /* NCMediaViewerHostingController.swift */; };
F75A64A0307DFAB50059B78E /* NCMediaViewerTransitionSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A646F307DFA6B0059B78E /* NCMediaViewerTransitionSource.swift */; };
F75A64A2307DFB870059B78E /* NCSidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A64A1307DFB870059B78E /* NCSidebarView.swift */; };
F75A64A4307DFB9E0059B78E /* NCMainTabBarController+Sidebar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A64A3307DFB9E0059B78E /* NCMainTabBarController+Sidebar.swift */; };
F75A64A6307DFBE60059B78E /* NCRecentNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A64A5307DFBE60059B78E /* NCRecentNavigationController.swift */; };
@@ -1431,6 +1441,9 @@
AB7000012F70000100FE2776 /* NCShareDetailsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCShareDetailsView.swift; sourceTree = "<group>"; };
AB7000032F70000100FE2776 /* NCShareDetailsGovernanceModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCShareDetailsGovernanceModel.swift; sourceTree = "<group>"; };
AB7000052F70000100FE2776 /* NCGovernanceLabelSelectorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCGovernanceLabelSelectorView.swift; sourceTree = "<group>"; };
AC13ADAF2026101300000001 /* NCMediaAdaptiveLayoutViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaAdaptiveLayoutViewTests.swift; sourceTree = "<group>"; };
AC14ADAF2026101400000001 /* NCMediaAdaptiveControlsLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaAdaptiveControlsLayout.swift; sourceTree = "<group>"; };
AC14ADAF2026101400000011 /* NCMediaViewerPreviewLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPreviewLoader.swift; sourceTree = "<group>"; };
AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAlertController+Extension.swift"; sourceTree = "<group>"; };
AF22B20B277C6F4D00DAB0CC /* NCShareCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCell.swift; sourceTree = "<group>"; };
AF22B215277D196700DAB0CC /* NCShareExtension+DataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCShareExtension+DataSource.swift"; sourceTree = "<group>"; };
@@ -1643,6 +1656,48 @@
F7501C312212E57400FB1415 /* NCMedia.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMedia.swift; sourceTree = "<group>"; };
F751247A2C42919C00E63DB8 /* NCPhotoCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCPhotoCell.swift; sourceTree = "<group>"; };
F751247B2C42919C00E63DB8 /* NCPhotoCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCPhotoCell.xib; sourceTree = "<group>"; };
F75175A7307F52E60057C9B0 /* NCAudioAdaptiveControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAudioAdaptiveControlsView.swift; sourceTree = "<group>"; };
F75175A9307F52E60057C9B0 /* NCAudioViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAudioViewerContentView.swift; sourceTree = "<group>"; };
F75175AB307F52E60057C9B0 /* NCImageAdaptiveControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageAdaptiveControlsView.swift; sourceTree = "<group>"; };
F75175AC307F52E60057C9B0 /* NCImageControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageControlsView.swift; sourceTree = "<group>"; };
F75175AE307F52E60057C9B0 /* NCImageViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageViewerContentView.swift; sourceTree = "<group>"; };
F75175AF307F52E60057C9B0 /* NCImageZoomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageZoomView.swift; sourceTree = "<group>"; };
F75175B0307F52E60057C9B0 /* NCLivePhotoViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLivePhotoViewerContentView.swift; sourceTree = "<group>"; };
F75175B2307F52E60057C9B0 /* NCVideoAVPlayerPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAVPlayerPresenter.swift; sourceTree = "<group>"; };
F75175B3307F52E60057C9B0 /* NCVideoAVPlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAVPlayerViewController.swift; sourceTree = "<group>"; };
F75175B4307F52E60057C9B0 /* NCVideoViewerContentView+AVPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCVideoViewerContentView+AVPlayer.swift"; sourceTree = "<group>"; };
F75175B6307F52E60057C9B0 /* NCVideoAdaptiveControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAdaptiveControlsView.swift; sourceTree = "<group>"; };
F75175B7307F52E60057C9B0 /* NCVideoAdaptivePlaybackCoverControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAdaptivePlaybackCoverControlsView.swift; sourceTree = "<group>"; };
F75175B8307F52E60057C9B0 /* NCVideoAVPlayerViewControls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAVPlayerViewControls.swift; sourceTree = "<group>"; };
F75175B9307F52E60057C9B0 /* NCVideoControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoControlsView.swift; sourceTree = "<group>"; };
F75175BA307F52E60057C9B0 /* NCVideoVLCViewControls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoVLCViewControls.swift; sourceTree = "<group>"; };
F75175BC307F52E60057C9B0 /* NCVideoViewerContentView+VLC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCVideoViewerContentView+VLC.swift"; sourceTree = "<group>"; };
F75175BD307F52E60057C9B0 /* NCVideoVLCPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoVLCPresenter.swift; sourceTree = "<group>"; };
F75175BE307F52E60057C9B0 /* NCVideoVLCViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoVLCViewController.swift; sourceTree = "<group>"; };
F75175C1307F52E60057C9B0 /* NCVideoPlaybackController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoPlaybackController.swift; sourceTree = "<group>"; };
F75175C2307F52E60057C9B0 /* NCVideoPlaybackCoverView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoPlaybackCoverView.swift; sourceTree = "<group>"; };
F75175C3307F52E60057C9B0 /* NCVideoURLResolver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoURLResolver.swift; sourceTree = "<group>"; };
F75175C4307F52E60057C9B0 /* NCVideoViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoViewerContentView.swift; sourceTree = "<group>"; };
F75175C7307F52E60057C9B0 /* NCMediaPlaybackOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaPlaybackOptions.swift; sourceTree = "<group>"; };
F75175C8307F52E60057C9B0 /* NCMediaViewerLoadingPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerLoadingPolicy.swift; sourceTree = "<group>"; };
F75175C9307F52E60057C9B0 /* NCMediaViewerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerModel.swift; sourceTree = "<group>"; };
F75175CA307F52E60057C9B0 /* NCMediaViewerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerView.swift; sourceTree = "<group>"; };
F75175CB307F52E60057C9B0 /* NCVideoPlaybackPresentationContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoPlaybackPresentationContext.swift; sourceTree = "<group>"; };
F75175CD307F52E60057C9B0 /* NCMediaViewerAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerAppearance.swift; sourceTree = "<group>"; };
F75175CE307F52E60057C9B0 /* NCMediaViewerTransitionSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerTransitionSource.swift; sourceTree = "<group>"; };
F75175CF307F52E60057C9B0 /* Notification+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+Extension.swift"; sourceTree = "<group>"; };
F75175D1307F52E60057C9B0 /* NCMediaAdaptiveControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaAdaptiveControlsView.swift; sourceTree = "<group>"; };
F75175D2307F52E60057C9B0 /* NCMediaAdaptivePagingFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaAdaptivePagingFooterView.swift; sourceTree = "<group>"; };
F75175D4307F52E60057C9B0 /* NCMediaAdaptiveLayoutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaAdaptiveLayoutView.swift; sourceTree = "<group>"; };
F75175D5307F52E60057C9B0 /* NCMediaViewerDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerDetailView.swift; sourceTree = "<group>"; };
F75175D6307F52E60057C9B0 /* NCMediaViewerFloatingTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerFloatingTitleView.swift; sourceTree = "<group>"; };
F75175D7307F52E60057C9B0 /* NCMediaViewerPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPageView.swift; sourceTree = "<group>"; };
F75175D8307F52E60057C9B0 /* NCMediaViewerPagingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPagingView.swift; sourceTree = "<group>"; };
F75175D9307F52E60057C9B0 /* NCMediaViewerThumbnail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerThumbnail.swift; sourceTree = "<group>"; };
F75175DB307F52E60057C9B0 /* NCMediaViewerHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerHostingController.swift; sourceTree = "<group>"; };
F75175DC307F52E60057C9B0 /* NCMediaViewerPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPresenter.swift; sourceTree = "<group>"; };
F75175DD307F52E60057C9B0 /* NCNextcloudMediaViewerLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCNextcloudMediaViewerLoader.swift; sourceTree = "<group>"; };
F75175DE307F52E60057C9B0 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
F752BA042E58C05200616A26 /* Maintenance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Maintenance.swift; sourceTree = "<group>"; };
F753701822723D620041C76C /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = gl; path = gl.lproj/Localizable.strings; sourceTree = "<group>"; };
F753701922723E0D0041C76C /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -1681,41 +1736,6 @@
F75A6431307DFA2C0059B78E /* AlbumsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumsViewController.swift; sourceTree = "<group>"; };
F75A6432307DFA2C0059B78E /* NCAlbums.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCAlbums.storyboard; sourceTree = "<group>"; };
F75A6433307DFA2C0059B78E /* NCAlbumsNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAlbumsNavigationController.swift; sourceTree = "<group>"; };
F75A644E307DFA6B0059B78E /* NCAudioViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAudioViewerContentView.swift; sourceTree = "<group>"; };
F75A6450307DFA6B0059B78E /* NCImageViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageViewerContentView.swift; sourceTree = "<group>"; };
F75A6451307DFA6B0059B78E /* NCImageZoomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageZoomView.swift; sourceTree = "<group>"; };
F75A6452307DFA6B0059B78E /* NCLivePhotoViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLivePhotoViewerContentView.swift; sourceTree = "<group>"; };
F75A6454307DFA6B0059B78E /* NCVideoAVPlayerPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAVPlayerPresenter.swift; sourceTree = "<group>"; };
F75A6455307DFA6B0059B78E /* NCVideoAVPlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAVPlayerViewController.swift; sourceTree = "<group>"; };
F75A6456307DFA6B0059B78E /* NCVideoViewerContentView+AVPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCVideoViewerContentView+AVPlayer.swift"; sourceTree = "<group>"; };
F75A6458307DFA6B0059B78E /* NCVideoAdaptiveControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAdaptiveControlsView.swift; sourceTree = "<group>"; };
F75A6459307DFA6B0059B78E /* NCVideoAVPlayerViewControls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAVPlayerViewControls.swift; sourceTree = "<group>"; };
F75A645A307DFA6B0059B78E /* NCVideoControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoControlsView.swift; sourceTree = "<group>"; };
F75A645B307DFA6B0059B78E /* NCVideoVLCViewControls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoVLCViewControls.swift; sourceTree = "<group>"; };
F75A645D307DFA6B0059B78E /* NCVideoViewerContentView+VLC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCVideoViewerContentView+VLC.swift"; sourceTree = "<group>"; };
F75A645E307DFA6B0059B78E /* NCVideoVLCPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoVLCPresenter.swift; sourceTree = "<group>"; };
F75A645F307DFA6B0059B78E /* NCVideoVLCViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoVLCViewController.swift; sourceTree = "<group>"; };
F75A6461307DFA6B0059B78E /* NCVideoAdaptiveLayoutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoAdaptiveLayoutView.swift; sourceTree = "<group>"; };
F75A6462307DFA6B0059B78E /* NCVideoPlaybackController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoPlaybackController.swift; sourceTree = "<group>"; };
F75A6463307DFA6B0059B78E /* NCVideoPlaybackCoverView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoPlaybackCoverView.swift; sourceTree = "<group>"; };
F75A6464307DFA6B0059B78E /* NCVideoURLResolver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoURLResolver.swift; sourceTree = "<group>"; };
F75A6465307DFA6B0059B78E /* NCVideoViewerContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoViewerContentView.swift; sourceTree = "<group>"; };
F75A6468307DFA6B0059B78E /* NCMediaPlaybackOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaPlaybackOptions.swift; sourceTree = "<group>"; };
F75A6469307DFA6B0059B78E /* NCMediaViewerLoadingPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerLoadingPolicy.swift; sourceTree = "<group>"; };
F75A646A307DFA6B0059B78E /* NCMediaViewerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerModel.swift; sourceTree = "<group>"; };
F75A646B307DFA6B0059B78E /* NCMediaViewerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerView.swift; sourceTree = "<group>"; };
F75A646C307DFA6B0059B78E /* NCVideoPlaybackPresentationContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCVideoPlaybackPresentationContext.swift; sourceTree = "<group>"; };
F75A646E307DFA6B0059B78E /* NCMediaViewerAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerAppearance.swift; sourceTree = "<group>"; };
F75A646F307DFA6B0059B78E /* NCMediaViewerTransitionSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerTransitionSource.swift; sourceTree = "<group>"; };
F75A6470307DFA6B0059B78E /* Notification+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+Extension.swift"; sourceTree = "<group>"; };
F75A6472307DFA6B0059B78E /* NCNextcloudMediaViewerLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCNextcloudMediaViewerLoader.swift; sourceTree = "<group>"; };
F75A6474307DFA6B0059B78E /* NCMediaViewerDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerDetailView.swift; sourceTree = "<group>"; };
F75A6475307DFA6B0059B78E /* NCMediaViewerFloatingTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerFloatingTitleView.swift; sourceTree = "<group>"; };
F75A6476307DFA6B0059B78E /* NCMediaViewerPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPageView.swift; sourceTree = "<group>"; };
F75A6477307DFA6B0059B78E /* NCMediaViewerPagingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPagingView.swift; sourceTree = "<group>"; };
F75A6478307DFA6B0059B78E /* NCMediaViewerThumbnail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerThumbnail.swift; sourceTree = "<group>"; };
F75A647A307DFA6B0059B78E /* NCMediaViewerHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerHostingController.swift; sourceTree = "<group>"; };
F75A647B307DFA6B0059B78E /* NCMediaViewerPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerPresenter.swift; sourceTree = "<group>"; };
F75A64A1307DFB870059B78E /* NCSidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSidebarView.swift; sourceTree = "<group>"; };
F75A64A3307DFB9E0059B78E /* NCMainTabBarController+Sidebar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCMainTabBarController+Sidebar.swift"; sourceTree = "<group>"; };
F75A64A5307DFBE60059B78E /* NCRecentNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCRecentNavigationController.swift; sourceTree = "<group>"; };
@@ -2366,6 +2386,7 @@
AA52EB442D42AC500089C348 /* NextcloudUnitTests */ = {
isa = PBXGroup;
children = (
AC13ADAF2026101300000001 /* NCMediaAdaptiveLayoutViewTests.swift */,
C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */,
C0DEA070306D000100000007 /* NCAutoUploadAssetTests.swift */,
F76BED7B306D0000002E1442 /* NCPhotoLibraryAssetTests.swift */,
@@ -2799,6 +2820,161 @@
path = Networking;
sourceTree = "<group>";
};
F75175A8307F52E60057C9B0 /* Controls */ = {
isa = PBXGroup;
children = (
F75175A7307F52E60057C9B0 /* NCAudioAdaptiveControlsView.swift */,
);
path = Controls;
sourceTree = "<group>";
};
F75175AA307F52E60057C9B0 /* Audio */ = {
isa = PBXGroup;
children = (
F75175A8307F52E60057C9B0 /* Controls */,
F75175A9307F52E60057C9B0 /* NCAudioViewerContentView.swift */,
);
path = Audio;
sourceTree = "<group>";
};
F75175AD307F52E60057C9B0 /* Controls */ = {
isa = PBXGroup;
children = (
F75175AB307F52E60057C9B0 /* NCImageAdaptiveControlsView.swift */,
F75175AC307F52E60057C9B0 /* NCImageControlsView.swift */,
);
path = Controls;
sourceTree = "<group>";
};
F75175B1307F52E60057C9B0 /* Image */ = {
isa = PBXGroup;
children = (
F75175AD307F52E60057C9B0 /* Controls */,
F75175AE307F52E60057C9B0 /* NCImageViewerContentView.swift */,
F75175AF307F52E60057C9B0 /* NCImageZoomView.swift */,
F75175B0307F52E60057C9B0 /* NCLivePhotoViewerContentView.swift */,
);
path = Image;
sourceTree = "<group>";
};
F75175B5307F52E60057C9B0 /* AVPlayer */ = {
isa = PBXGroup;
children = (
F75175B2307F52E60057C9B0 /* NCVideoAVPlayerPresenter.swift */,
F75175B3307F52E60057C9B0 /* NCVideoAVPlayerViewController.swift */,
F75175B4307F52E60057C9B0 /* NCVideoViewerContentView+AVPlayer.swift */,
);
path = AVPlayer;
sourceTree = "<group>";
};
F75175BB307F52E60057C9B0 /* Controls */ = {
isa = PBXGroup;
children = (
F75175B6307F52E60057C9B0 /* NCVideoAdaptiveControlsView.swift */,
F75175B7307F52E60057C9B0 /* NCVideoAdaptivePlaybackCoverControlsView.swift */,
F75175B8307F52E60057C9B0 /* NCVideoAVPlayerViewControls.swift */,
F75175B9307F52E60057C9B0 /* NCVideoControlsView.swift */,
F75175BA307F52E60057C9B0 /* NCVideoVLCViewControls.swift */,
);
path = Controls;
sourceTree = "<group>";
};
F75175BF307F52E60057C9B0 /* VLC */ = {
isa = PBXGroup;
children = (
F75175BC307F52E60057C9B0 /* NCVideoViewerContentView+VLC.swift */,
F75175BD307F52E60057C9B0 /* NCVideoVLCPresenter.swift */,
F75175BE307F52E60057C9B0 /* NCVideoVLCViewController.swift */,
);
path = VLC;
sourceTree = "<group>";
};
F75175C5307F52E60057C9B0 /* Video */ = {
isa = PBXGroup;
children = (
F75175B5307F52E60057C9B0 /* AVPlayer */,
F75175BB307F52E60057C9B0 /* Controls */,
F75175BF307F52E60057C9B0 /* VLC */,
F75175C1307F52E60057C9B0 /* NCVideoPlaybackController.swift */,
F75175C2307F52E60057C9B0 /* NCVideoPlaybackCoverView.swift */,
F75175C3307F52E60057C9B0 /* NCVideoURLResolver.swift */,
F75175C4307F52E60057C9B0 /* NCVideoViewerContentView.swift */,
);
path = Video;
sourceTree = "<group>";
};
F75175C6307F52E60057C9B0 /* Content */ = {
isa = PBXGroup;
children = (
F75175AA307F52E60057C9B0 /* Audio */,
F75175B1307F52E60057C9B0 /* Image */,
F75175C5307F52E60057C9B0 /* Video */,
);
path = Content;
sourceTree = "<group>";
};
F75175CC307F52E60057C9B0 /* Core */ = {
isa = PBXGroup;
children = (
F75175C7307F52E60057C9B0 /* NCMediaPlaybackOptions.swift */,
F75175C8307F52E60057C9B0 /* NCMediaViewerLoadingPolicy.swift */,
F75175C9307F52E60057C9B0 /* NCMediaViewerModel.swift */,
F75175CA307F52E60057C9B0 /* NCMediaViewerView.swift */,
F75175CB307F52E60057C9B0 /* NCVideoPlaybackPresentationContext.swift */,
);
path = Core;
sourceTree = "<group>";
};
F75175D0307F52E60057C9B0 /* Helpers */ = {
isa = PBXGroup;
children = (
F75175CD307F52E60057C9B0 /* NCMediaViewerAppearance.swift */,
AC14ADAF2026101400000001 /* NCMediaAdaptiveControlsLayout.swift */,
AC14ADAF2026101400000011 /* NCMediaViewerPreviewLoader.swift */,
F75175CE307F52E60057C9B0 /* NCMediaViewerTransitionSource.swift */,
F75175CF307F52E60057C9B0 /* Notification+Extension.swift */,
);
path = Helpers;
sourceTree = "<group>";
};
F75175D3307F52E60057C9B0 /* Controls */ = {
isa = PBXGroup;
children = (
F75175D1307F52E60057C9B0 /* NCMediaAdaptiveControlsView.swift */,
F75175D2307F52E60057C9B0 /* NCMediaAdaptivePagingFooterView.swift */,
);
path = Controls;
sourceTree = "<group>";
};
F75175DA307F52E60057C9B0 /* Views */ = {
isa = PBXGroup;
children = (
F75175D3307F52E60057C9B0 /* Controls */,
F75175D4307F52E60057C9B0 /* NCMediaAdaptiveLayoutView.swift */,
F75175D5307F52E60057C9B0 /* NCMediaViewerDetailView.swift */,
F75175D6307F52E60057C9B0 /* NCMediaViewerFloatingTitleView.swift */,
F75175D7307F52E60057C9B0 /* NCMediaViewerPageView.swift */,
F75175D8307F52E60057C9B0 /* NCMediaViewerPagingView.swift */,
F75175D9307F52E60057C9B0 /* NCMediaViewerThumbnail.swift */,
);
path = Views;
sourceTree = "<group>";
};
F75175DF307F52E60057C9B0 /* NCViewerMedia */ = {
isa = PBXGroup;
children = (
F75175CC307F52E60057C9B0 /* Core */,
F75175DA307F52E60057C9B0 /* Views */,
F75175C6307F52E60057C9B0 /* Content */,
F75175D0307F52E60057C9B0 /* Helpers */,
F75175DB307F52E60057C9B0 /* NCMediaViewerHostingController.swift */,
F75175DC307F52E60057C9B0 /* NCMediaViewerPresenter.swift */,
F75175DD307F52E60057C9B0 /* NCNextcloudMediaViewerLoader.swift */,
F75175DE307F52E60057C9B0 /* README.md */,
);
path = NCViewerMedia;
sourceTree = "<group>";
};
F757CC8929E82D0500F31428 /* Groupfolders */ = {
isa = PBXGroup;
children = (
@@ -2918,136 +3094,6 @@
path = Albums;
sourceTree = "<group>";
};
F75A644F307DFA6B0059B78E /* Audio */ = {
isa = PBXGroup;
children = (
F75A644E307DFA6B0059B78E /* NCAudioViewerContentView.swift */,
);
path = Audio;
sourceTree = "<group>";
};
F75A6453307DFA6B0059B78E /* Image */ = {
isa = PBXGroup;
children = (
F75A6450307DFA6B0059B78E /* NCImageViewerContentView.swift */,
F75A6451307DFA6B0059B78E /* NCImageZoomView.swift */,
F75A6452307DFA6B0059B78E /* NCLivePhotoViewerContentView.swift */,
);
path = Image;
sourceTree = "<group>";
};
F75A6457307DFA6B0059B78E /* AVPlayer */ = {
isa = PBXGroup;
children = (
F75A6454307DFA6B0059B78E /* NCVideoAVPlayerPresenter.swift */,
F75A6455307DFA6B0059B78E /* NCVideoAVPlayerViewController.swift */,
F75A6456307DFA6B0059B78E /* NCVideoViewerContentView+AVPlayer.swift */,
);
path = AVPlayer;
sourceTree = "<group>";
};
F75A645C307DFA6B0059B78E /* Controls */ = {
isa = PBXGroup;
children = (
F75A6458307DFA6B0059B78E /* NCVideoAdaptiveControlsView.swift */,
F75A6459307DFA6B0059B78E /* NCVideoAVPlayerViewControls.swift */,
F75A645A307DFA6B0059B78E /* NCVideoControlsView.swift */,
F75A645B307DFA6B0059B78E /* NCVideoVLCViewControls.swift */,
);
path = Controls;
sourceTree = "<group>";
};
F75A6460307DFA6B0059B78E /* VLC */ = {
isa = PBXGroup;
children = (
F75A645D307DFA6B0059B78E /* NCVideoViewerContentView+VLC.swift */,
F75A645E307DFA6B0059B78E /* NCVideoVLCPresenter.swift */,
F75A645F307DFA6B0059B78E /* NCVideoVLCViewController.swift */,
);
path = VLC;
sourceTree = "<group>";
};
F75A6466307DFA6B0059B78E /* Video */ = {
isa = PBXGroup;
children = (
F75A6457307DFA6B0059B78E /* AVPlayer */,
F75A645C307DFA6B0059B78E /* Controls */,
F75A6460307DFA6B0059B78E /* VLC */,
F75A6461307DFA6B0059B78E /* NCVideoAdaptiveLayoutView.swift */,
F75A6462307DFA6B0059B78E /* NCVideoPlaybackController.swift */,
F75A6463307DFA6B0059B78E /* NCVideoPlaybackCoverView.swift */,
F75A6464307DFA6B0059B78E /* NCVideoURLResolver.swift */,
F75A6465307DFA6B0059B78E /* NCVideoViewerContentView.swift */,
);
path = Video;
sourceTree = "<group>";
};
F75A6467307DFA6B0059B78E /* Content */ = {
isa = PBXGroup;
children = (
F75A644F307DFA6B0059B78E /* Audio */,
F75A6453307DFA6B0059B78E /* Image */,
F75A6466307DFA6B0059B78E /* Video */,
);
path = Content;
sourceTree = "<group>";
};
F75A646D307DFA6B0059B78E /* Core */ = {
isa = PBXGroup;
children = (
F75A6468307DFA6B0059B78E /* NCMediaPlaybackOptions.swift */,
F75A6469307DFA6B0059B78E /* NCMediaViewerLoadingPolicy.swift */,
F75A646A307DFA6B0059B78E /* NCMediaViewerModel.swift */,
F75A646B307DFA6B0059B78E /* NCMediaViewerView.swift */,
F75A646C307DFA6B0059B78E /* NCVideoPlaybackPresentationContext.swift */,
);
path = Core;
sourceTree = "<group>";
};
F75A6471307DFA6B0059B78E /* Helpers */ = {
isa = PBXGroup;
children = (
F75A646E307DFA6B0059B78E /* NCMediaViewerAppearance.swift */,
F75A646F307DFA6B0059B78E /* NCMediaViewerTransitionSource.swift */,
F75A6470307DFA6B0059B78E /* Notification+Extension.swift */,
);
path = Helpers;
sourceTree = "<group>";
};
F75A6473307DFA6B0059B78E /* Loading */ = {
isa = PBXGroup;
children = (
F75A6472307DFA6B0059B78E /* NCNextcloudMediaViewerLoader.swift */,
);
path = Loading;
sourceTree = "<group>";
};
F75A6479307DFA6B0059B78E /* Views */ = {
isa = PBXGroup;
children = (
F75A6474307DFA6B0059B78E /* NCMediaViewerDetailView.swift */,
F75A6475307DFA6B0059B78E /* NCMediaViewerFloatingTitleView.swift */,
F75A6476307DFA6B0059B78E /* NCMediaViewerPageView.swift */,
F75A6477307DFA6B0059B78E /* NCMediaViewerPagingView.swift */,
F75A6478307DFA6B0059B78E /* NCMediaViewerThumbnail.swift */,
);
path = Views;
sourceTree = "<group>";
};
F75A647C307DFA6B0059B78E /* NCViewerMedia */ = {
isa = PBXGroup;
children = (
F75A6467307DFA6B0059B78E /* Content */,
F75A646D307DFA6B0059B78E /* Core */,
F75A6471307DFA6B0059B78E /* Helpers */,
F75A6473307DFA6B0059B78E /* Loading */,
F75A6479307DFA6B0059B78E /* Views */,
F75A647A307DFA6B0059B78E /* NCMediaViewerHostingController.swift */,
F75A647B307DFA6B0059B78E /* NCMediaViewerPresenter.swift */,
);
path = NCViewerMedia;
sourceTree = "<group>";
};
F75DD764290AB369002EB562 /* Intent */ = {
isa = PBXGroup;
children = (
@@ -3390,7 +3436,7 @@
children = (
F7F9D1BA25397CE000D9BFF5 /* NCViewer.swift */,
F7EFA47725ADBA500083159A /* NCViewerProviderContextMenu.swift */,
F75A647C307DFA6B0059B78E /* NCViewerMedia */,
F75175DF307F52E60057C9B0 /* NCViewerMedia */,
F7C8A93B3025BCBC004E3A10 /* NCViewerDocument */,
F723986A253C9C0E00257F49 /* NCViewerQuickLook */,
F76D3CEF2428B3DD005DFA87 /* NCViewerPDF */,
@@ -4660,6 +4706,7 @@
F774264A22EB4D0000B23912 /* NCSearchUserDropDownCell.xib in Resources */,
F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
F75175E0307F52E60057C9B0 /* README.md in Resources */,
F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */,
F7EDE514262DC2CD00414FE6 /* NCSelectCommandViewSelect+CreateFolder.xib in Resources */,
F7B398422A6A91D5007538D6 /* NCSectionFirstHeader.xib in Resources */,
@@ -4804,6 +4851,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AC13ADAF2026101300000002 /* NCMediaAdaptiveLayoutViewTests.swift in Sources */,
C0DEDA7E30C1000100A00002 /* NCAutoUploadDateTests.swift in Sources */,
C0DEA070306D000100000008 /* NCAutoUploadAssetTests.swift in Sources */,
F76BED7E306D0000002E1442 /* NCPhotoLibraryAssetTests.swift in Sources */,
@@ -4965,7 +5013,7 @@
F7D4BF392CA2E8D800A5E746 /* TOPasscodeCircleView.m in Sources */,
F7D4BF3A2CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m in Sources */,
F79792482F5EECE100FE9544 /* Font+Extension.swift in Sources */,
F75A64A0307DFAB50059B78E /* NCMediaViewerTransitionSource.swift in Sources */,
F751760B307F53680057C9B0 /* NCMediaViewerTransitionSource.swift in Sources */,
F7D61EBF2EBF1878007F865B /* NCManageDatabase+Tag.swift in Sources */,
F7D4BF3B2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m in Sources */,
F7D4BF3C2CA2E8D800A5E746 /* TOPasscodeViewController.m in Sources */,
@@ -5271,41 +5319,6 @@
F71916142E2901FB00E13E96 /* NCNetworking+Upload.swift in Sources */,
F704B5E92430C0B800632F5F /* NCCreateFormUploadConflictCell.swift in Sources */,
F72D404923D2082500A97FD0 /* NCViewerDirectEditing.swift in Sources */,
F75A647D307DFA6B0059B78E /* NCImageZoomView.swift in Sources */,
F75A647E307DFA6B0059B78E /* NCMediaViewerThumbnail.swift in Sources */,
F75A647F307DFA6B0059B78E /* NCMediaViewerView.swift in Sources */,
F75A6480307DFA6B0059B78E /* NCMediaViewerModel.swift in Sources */,
F75A6481307DFA6B0059B78E /* NCAudioViewerContentView.swift in Sources */,
F75A6482307DFA6B0059B78E /* NCVideoViewerContentView.swift in Sources */,
F75A6483307DFA6B0059B78E /* NCVideoURLResolver.swift in Sources */,
F75A6484307DFA6B0059B78E /* NCVideoVLCViewController.swift in Sources */,
F75A6485307DFA6B0059B78E /* NCLivePhotoViewerContentView.swift in Sources */,
F75A6486307DFA6B0059B78E /* NCVideoAVPlayerPresenter.swift in Sources */,
F75A6487307DFA6B0059B78E /* NCVideoViewerContentView+VLC.swift in Sources */,
F75A6488307DFA6B0059B78E /* NCMediaViewerPagingView.swift in Sources */,
F75A6489307DFA6B0059B78E /* NCVideoVLCPresenter.swift in Sources */,
F75A648A307DFA6B0059B78E /* NCVideoAVPlayerViewControls.swift in Sources */,
F75A648B307DFA6B0059B78E /* NCVideoPlaybackCoverView.swift in Sources */,
F75A648C307DFA6B0059B78E /* Notification+Extension.swift in Sources */,
F75A648D307DFA6B0059B78E /* NCVideoAdaptiveLayoutView.swift in Sources */,
F75A648E307DFA6B0059B78E /* NCVideoVLCViewControls.swift in Sources */,
F75A648F307DFA6B0059B78E /* NCMediaViewerPageView.swift in Sources */,
F75A6490307DFA6B0059B78E /* NCVideoViewerContentView+AVPlayer.swift in Sources */,
F75A6491307DFA6B0059B78E /* NCVideoPlaybackController.swift in Sources */,
F75A6492307DFA6B0059B78E /* NCImageViewerContentView.swift in Sources */,
F75A6493307DFA6B0059B78E /* NCMediaViewerPresenter.swift in Sources */,
F75A6494307DFA6B0059B78E /* NCMediaPlaybackOptions.swift in Sources */,
F75A6495307DFA6B0059B78E /* NCMediaViewerDetailView.swift in Sources */,
F75A6496307DFA6B0059B78E /* NCMediaViewerFloatingTitleView.swift in Sources */,
F75A6497307DFA6B0059B78E /* NCVideoAdaptiveControlsView.swift in Sources */,
F75A6498307DFA6B0059B78E /* NCVideoPlaybackPresentationContext.swift in Sources */,
F75A6499307DFA6B0059B78E /* NCMediaViewerTransitionSource.swift in Sources */,
F75A649A307DFA6B0059B78E /* NCMediaViewerAppearance.swift in Sources */,
F75A649B307DFA6B0059B78E /* NCNextcloudMediaViewerLoader.swift in Sources */,
F75A649C307DFA6B0059B78E /* NCVideoAVPlayerViewController.swift in Sources */,
F75A649D307DFA6B0059B78E /* NCMediaViewerLoadingPolicy.swift in Sources */,
F75A649E307DFA6B0059B78E /* NCVideoControlsView.swift in Sources */,
F75A649F307DFA6B0059B78E /* NCMediaViewerHostingController.swift in Sources */,
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */,
F77BB746289984CA0090FC19 /* UIViewController+Extension.swift in Sources */,
F700510522DF6A89003A3356 /* NCShare.swift in Sources */,
@@ -5354,6 +5367,49 @@
F7F3E58E2D3BB65600A32B14 /* NCNetworking+Recommendations.swift in Sources */,
F75A64AC307DFC370059B78E /* NCOfflineNavigationController.swift in Sources */,
F7A0D1352591FBC5008F8A13 /* String+Extension.swift in Sources */,
F75175E1307F52E60057C9B0 /* NCMediaViewerView.swift in Sources */,
F75175E2307F52E60057C9B0 /* NCMediaViewerHostingController.swift in Sources */,
F75175E3307F52E60057C9B0 /* NCImageAdaptiveControlsView.swift in Sources */,
F75175E4307F52E60057C9B0 /* NCMediaPlaybackOptions.swift in Sources */,
F75175E5307F52E60057C9B0 /* NCVideoVLCViewController.swift in Sources */,
F75175E6307F52E60057C9B0 /* NCVideoPlaybackPresentationContext.swift in Sources */,
F75175E7307F52E60057C9B0 /* NCVideoViewerContentView+VLC.swift in Sources */,
F75175E8307F52E60057C9B0 /* NCVideoAVPlayerViewControls.swift in Sources */,
F75175E9307F52E60057C9B0 /* NCMediaViewerPagingView.swift in Sources */,
F75175EA307F52E60057C9B0 /* NCMediaAdaptivePagingFooterView.swift in Sources */,
F75175EB307F52E60057C9B0 /* NCImageControlsView.swift in Sources */,
F75175EC307F52E60057C9B0 /* NCMediaViewerTransitionSource.swift in Sources */,
F75175ED307F52E60057C9B0 /* NCVideoAdaptivePlaybackCoverControlsView.swift in Sources */,
F75175EE307F52E60057C9B0 /* NCMediaAdaptiveControlsView.swift in Sources */,
F75175EF307F52E60057C9B0 /* NCMediaViewerPresenter.swift in Sources */,
F75175F0307F52E60057C9B0 /* NCMediaViewerFloatingTitleView.swift in Sources */,
F75175F1307F52E60057C9B0 /* NCVideoVLCViewControls.swift in Sources */,
F75175F2307F52E60057C9B0 /* NCMediaViewerThumbnail.swift in Sources */,
F75175F3307F52E60057C9B0 /* NCLivePhotoViewerContentView.swift in Sources */,
F75175F4307F52E60057C9B0 /* NCAudioAdaptiveControlsView.swift in Sources */,
F75175F5307F52E60057C9B0 /* NCMediaViewerLoadingPolicy.swift in Sources */,
F75175F6307F52E60057C9B0 /* NCVideoAdaptiveControlsView.swift in Sources */,
F75175F7307F52E60057C9B0 /* NCMediaViewerPageView.swift in Sources */,
F75175F8307F52E60057C9B0 /* NCImageZoomView.swift in Sources */,
F75175F9307F52E60057C9B0 /* Notification+Extension.swift in Sources */,
F75175FA307F52E60057C9B0 /* NCAudioViewerContentView.swift in Sources */,
F75175FB307F52E60057C9B0 /* NCVideoViewerContentView+AVPlayer.swift in Sources */,
F75175FC307F52E60057C9B0 /* NCVideoAVPlayerPresenter.swift in Sources */,
F75175FD307F52E60057C9B0 /* NCVideoPlaybackCoverView.swift in Sources */,
F75175FE307F52E60057C9B0 /* NCVideoPlaybackController.swift in Sources */,
F75175FF307F52E60057C9B0 /* NCVideoControlsView.swift in Sources */,
F7517600307F52E60057C9B0 /* NCVideoURLResolver.swift in Sources */,
F7517601307F52E60057C9B0 /* NCVideoViewerContentView.swift in Sources */,
F7517602307F52E60057C9B0 /* NCVideoVLCPresenter.swift in Sources */,
F7517603307F52E60057C9B0 /* NCMediaViewerDetailView.swift in Sources */,
F7517604307F52E60057C9B0 /* NCNextcloudMediaViewerLoader.swift in Sources */,
F7517605307F52E60057C9B0 /* NCMediaViewerModel.swift in Sources */,
F7517606307F52E60057C9B0 /* NCVideoAVPlayerViewController.swift in Sources */,
F7517608307F52E60057C9B0 /* NCMediaViewerAppearance.swift in Sources */,
AC14ADAF2026101400000002 /* NCMediaAdaptiveControlsLayout.swift in Sources */,
AC14ADAF2026101400000012 /* NCMediaViewerPreviewLoader.swift in Sources */,
F7517609307F52E60057C9B0 /* NCMediaAdaptiveLayoutView.swift in Sources */,
F751760A307F52E60057C9B0 /* NCImageViewerContentView.swift in Sources */,
F7CEE6012BA9A5C9003EFD89 /* NCTrashGridCell.swift in Sources */,
F70557BD2ED44F1800135623 /* UploadBannerView.swift in Sources */,
F7F9D1BB25397CE000D9BFF5 /* NCViewer.swift in Sources */,
@@ -6783,7 +6839,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 35.1.1;
MARKETING_VERSION = 35.2.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-v";
OTHER_LDFLAGS = "";
@@ -6849,7 +6905,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 35.1.1;
MARKETING_VERSION = 35.2.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-v";
OTHER_LDFLAGS = "";
@@ -56,9 +56,9 @@
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F31F69412A2F6D4500162F76"
BuildableName = "NextcloudSnapshotTests.xctest"
BlueprintName = "NextcloudSnapshotTests"
BlueprintIdentifier = "AF8ED1F82757821000B8DBC4"
BuildableName = "NextcloudUnitTests.xctest"
BlueprintName = "NextcloudUnitTests"
ReferencedContainer = "container:Nextcloud.xcodeproj">
</BuildableReference>
</BuildActionEntry>
+5 -1
View File
@@ -34,7 +34,11 @@ class NCShareCell: UITableViewCell {
imageCell?.layer.cornerRadius = 6
imageCell?.layer.masksToBounds = true
if let image = UIImage.downsample(imageAt: URL(fileURLWithPath: NSTemporaryDirectory() + fileName), to: CGSize(width: 80, height: 80)) {
if let image = UIImage.downsample(
imageAt: URL(fileURLWithPath: NSTemporaryDirectory() + fileName),
to: CGSize(width: 80, height: 80),
scale: traitCollection.displayScale
) {
imageCell.image = image
imageCell.contentMode = .scaleAspectFill
} else {
@@ -34,8 +34,8 @@ extension NCShareExtension: NCAccountRequestDelegate {
vcAccountRequest.delegate = self
vcAccountRequest.dismissDidEnterBackground = true
let screenHeighMax = UIScreen.main.bounds.height - (UIScreen.main.bounds.height / 5)
let height = min(CGFloat(accounts.count * Int(vcAccountRequest.heightCell) + 45), screenHeighMax)
let maximumHeight = view.safeAreaLayoutGuide.layoutFrame.height * 0.8
let height = min(CGFloat(accounts.count * Int(vcAccountRequest.heightCell) + 45), maximumHeight)
let popup = NCPopupViewController(contentController: vcAccountRequest, popupWidth: 300, popupHeight: height + 20)
@@ -9,6 +9,31 @@ import Testing
@Suite("Auto Upload incremental date backup compatibility")
@MainActor
struct NCAutoUploadDateTests {
@Test("Whole-library discovery stays unfiltered as upload progress advances")
func wholeLibraryDiscoveryIgnoresProgress() {
let account = tableAccount()
account.autoUploadAllPhotos = true
for date in [nil, Date(timeIntervalSince1970: 100), Date(timeIntervalSince1970: 200)] {
account.autoUploadSinceDate = date
#expect(account.autoUploadDatePredicate == nil)
}
}
@Test("Date-limited discovery includes the boundary and newer assets, and switching to all removes the filter")
func dateLimitedDiscovery() throws {
let account = tableAccount()
account.autoUploadSinceDate = Date(timeIntervalSince1970: 100)
let predicate = try #require(account.autoUploadDatePredicate)
#expect(!predicate.evaluate(with: ["creationDate": Date(timeIntervalSince1970: 99)]))
#expect(predicate.evaluate(with: ["creationDate": Date(timeIntervalSince1970: 100)]))
#expect(predicate.evaluate(with: ["creationDate": Date(timeIntervalSince1970: 101)]))
account.autoUploadAllPhotos = true
#expect(account.autoUploadDatePredicate == nil)
account.autoUploadAllPhotos = false
#expect(account.autoUploadDatePredicate != nil)
}
@Test("Account backup preserves the incremental restart date")
func backupRoundTrip() throws {
let account = tableAccount()
@@ -21,6 +46,7 @@ struct NCAutoUploadDateTests {
@Test("A whole-library selection remains unfiltered after account restore")
func wholeLibraryRoundTrip() throws {
let account = tableAccount()
account.autoUploadAllPhotos = true
let data = try JSONEncoder().encode(account.tableAccountToCodable())
let decoded = try JSONDecoder().decode(tableAccountCodable.self, from: data)
#expect(tableAccount(codableObject: decoded).autoUploadSinceDate == nil)
@@ -49,6 +75,7 @@ struct NCAutoUploadDateTests {
let restored = tableAccount(codableObject: decoded)
#expect(restored.autoUploadAllPhotos)
#expect(restored.autoUploadSinceDate == account.autoUploadSinceDate)
#expect(restored.autoUploadDatePredicate == nil)
}
@Test("Older backups infer the library selection from their existing date")
@@ -85,6 +85,51 @@ struct NCImageZoomViewTests {
}
}
@Test("Images remain fitted and centered through an upper-region round trip", arguments: [
CGSize(width: 400, height: 300),
CGSize(width: 300, height: 400),
CGSize(width: 400, height: 400)
])
func centersImageThroughFoldRoundTrip(imageSize: CGSize) {
let (coordinator, scrollView, imageView) = makeZoomView(imageSize: imageSize)
// UIScrollView rounds offsets to physical pixels; an exact center can fall halfway between them.
let centeringTolerance = 0.5 / max(scrollView.traitCollection.displayScale, 1) + 0.001
for size in [CGSize(width: 320, height: 480), CGSize(width: 320, height: 220), CGSize(width: 320, height: 480)] {
scrollView.bounds.size = size
coordinator.layoutImageViewPreservingOnBoundsChange()
let scale = min(size.width / imageSize.width, size.height / imageSize.height)
#expect(abs(imageView.frame.width - imageSize.width * scale) < 0.001)
#expect(abs(imageView.frame.height - imageSize.height * scale) < 0.001)
let visibleCenter = imageView.convert(
CGPoint(x: imageView.bounds.midX, y: imageView.bounds.midY),
to: scrollView
)
#expect(abs(visibleCenter.x - scrollView.bounds.midX) < centeringTolerance)
#expect(abs(visibleCenter.y - scrollView.bounds.midY) < centeringTolerance)
#expect(coordinator.zoomState() == nil)
}
}
@Test("Folding and unfolding retain the zoomed image focal point")
func preservesImageZoomThroughFoldRoundTrip() throws {
let (coordinator, scrollView, _) = makeZoomView(imageSize: CGSize(width: 400, height: 300))
scrollView.setZoomScale(3, animated: false)
scrollView.contentOffset = CGPoint(x: 320, y: 120)
coordinator.recordCurrentZoomState()
let savedState = try #require(coordinator.zoomState())
for size in [CGSize(width: 320, height: 220), CGSize(width: 320, height: 480)] {
scrollView.bounds.size = size
coordinator.layoutImageViewPreservingOnBoundsChange()
let restoredState = try #require(coordinator.zoomState())
#expect(abs(restoredState.zoomScale - savedState.zoomScale) < 0.001)
#expect(abs(restoredState.normalizedCenter.x - savedState.normalizedCenter.x) < 0.001)
#expect(abs(restoredState.normalizedCenter.y - savedState.normalizedCenter.y) < 0.001)
}
}
@Test("Double-tap zoom survives view recreation and rotation")
func preservesDoubleTapZoomAfterViewRecreation() throws {
var persistedZoomState: NCImageZoomView.ZoomState?
@@ -0,0 +1,555 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
import Testing
import UIKit
import NextcloudKit
@testable import Nextcloud
@Suite("Adaptive media layout")
@MainActor
struct NCMediaAdaptiveLayoutViewTests {
@Test("Adaptive navigation remains within the available middle area", arguments: [CGFloat(-1), 0, 20, 49, 100, 330, 500])
func navigationFitsSmallAndLargeRegions(height: CGFloat) {
let navigationHeight = NCMediaAdaptiveControlsLayout.navigationHeight(availableHeight: height)
#expect(navigationHeight >= 0)
#expect(navigationHeight <= max(0, height - NCMediaAdaptiveControlsLayout.spacing))
#expect(navigationHeight <= NCMediaAdaptiveControlsLayout.actionsHeight)
if height >= NCMediaAdaptiveControlsLayout.actionsHeight + NCMediaAdaptiveControlsLayout.spacing {
#expect(navigationHeight == NCMediaAdaptiveControlsLayout.actionsHeight)
}
}
@Test("Folded video playback stays black and unfolded playback retains its policy", arguments: [false, true])
func videoPlaybackBackground(isChromeHidden: Bool) {
let folded = ncViewerVideoPlaybackBackgroundStyle(for: nil, isChromeHidden: isChromeHidden, isFoldedLayout: true)
let unfolded = ncViewerVideoPlaybackBackgroundStyle(for: nil, isChromeHidden: isChromeHidden, isFoldedLayout: false)
for appearance in [UIUserInterfaceStyle.light, .dark] {
let traits = UITraitCollection(userInterfaceStyle: appearance)
#expect(UIColor.ncViewerBackground(folded).resolvedColor(with: traits).isEqual(UIColor.black))
let expected = UIColor.ncViewerBackground(ncViewerBackgroundStyle(for: nil, isChromeHidden: isChromeHidden)).resolvedColor(with: traits)
#expect(UIColor.ncViewerBackground(unfolded).resolvedColor(with: traits).isEqual(expected))
}
}
@Test("Control appearance follows the viewer background", arguments: [ColorScheme.light, .dark])
func controlAppearanceMatchesBackground(inherited: ColorScheme) {
#expect(ncViewerAdaptiveControlsColorScheme(for: .system, inherited: inherited) == inherited)
#expect(ncViewerAdaptiveControlsColorScheme(for: .black, inherited: inherited) == .dark)
#expect(ncViewerAdaptiveControlsColorScheme(for: .white, inherited: inherited) == .light)
}
@Test("Normal and adaptive media share the standard appearance and tap behavior", arguments: [false, true])
func normalBackgroundPreservesAppearanceAndChrome(isChromeHidden: Bool) {
let style = ncViewerBackgroundStyle(for: nil, isChromeHidden: isChromeHidden)
let panelStyle = ncViewerAdaptivePanelBackgroundStyle(contentStyle: style)
for appearance in [UIUserInterfaceStyle.light, .dark] {
let traits = UITraitCollection(userInterfaceStyle: appearance)
let expected = (isChromeHidden ? UIColor.black : UIColor.systemBackground).resolvedColor(with: traits)
#expect(UIColor.ncViewerBackground(style).resolvedColor(with: traits).isEqual(expected))
#expect(UIColor.ncViewerBackground(panelStyle).resolvedColor(with: traits).isEqual(expected))
}
}
@Test("Adaptive video footer retains its host and reserves the shared bottom lane")
func videoFooterPreservesHostOnResize() throws {
let metadata = tableMetadata()
metadata.ocId = "video-footer"
metadata.classFile = NKTypeClassFile.video.rawValue
let model = NCMediaViewerModel(
currentMetadata: metadata, ocIds: [metadata.ocId],
session: NCSession().getSession(account: ""), loader: NCMediaViewerLoader()
)
let controls = NCVideoAdaptiveControlsView(state: NCVideoControlsState())
// Give Auto Layout a fixed container; the hosted SwiftUI content must not size the test root.
let container = UIView(frame: CGRect(x: 0, y: 0, width: 430, height: 330))
container.addSubview(controls)
NSLayoutConstraint.activate([
controls.leadingAnchor.constraint(equalTo: container.leadingAnchor),
controls.trailingAnchor.constraint(equalTo: container.trailingAnchor),
controls.topAnchor.constraint(equalTo: container.topAnchor),
controls.bottomAnchor.constraint(equalTo: container.bottomAnchor)
])
controls.configurePaging(model: model, onSelectPage: { _ in })
let host = try #require(controls.pagingFooterView.subviews.first)
for height in [CGFloat(330), 500] {
container.frame.size.height = height
container.setNeedsLayout()
container.layoutIfNeeded()
#expect(controls.bounds.size == CGSize(width: 430, height: height))
let middleHeight = max(
0, height - NCMediaAdaptiveActionsView.preferredHeight - NCMediaViewerThumbnail.preferredHeight - 20 - NCMediaAdaptiveControlsLayout.thumbnailBottomInset
)
let navigationHeight = min(max(0, middleHeight - 5), NCMediaAdaptiveControlsLayout.actionsHeight)
#expect(controls.pagingFooterView.frame.maxY == height)
#expect(controls.pagingFooterView.frame.height == navigationHeight + NCMediaViewerThumbnail.preferredHeight + 15 + NCMediaAdaptiveControlsLayout.thumbnailBottomInset)
#expect(controls.pagingFooterView.subviews.first === host)
#expect(controls.bottomControlsView.frame.maxY <= controls.pagingFooterView.frame.minY)
}
controls.configurePaging(model: nil, onSelectPage: { _ in })
container.layoutIfNeeded()
#expect(controls.pagingFooterView.subviews.isEmpty)
#expect(controls.pagingFooterView.frame == .zero)
}
@Test("Adaptive controls share playback state without adding a navigation bar")
func separateAdaptiveControls() throws {
let normalControls = NCVideoControlsView()
let adaptiveControls = NCVideoAdaptiveControlsView(state: normalControls.state)
adaptiveControls.configureAdaptiveActions(closeAction: UIAction { _ in }, moreButton: UIButton(type: .system))
#expect(adaptiveControls.actionsContainerView.superview === adaptiveControls)
#expect(!adaptiveControls.subviews.contains { $0 is UINavigationBar })
#expect(!normalControls.subviews.contains { $0 is UINavigationBar })
normalControls.updateProgress(progress: 0.5, elapsedText: "1:00", remainingText: "−1:00")
adaptiveControls.updatePlaybackOptions(isRepeatEnabled: true, isAutoAdvanceEnabled: true)
#expect(adaptiveControls.state.progress == 0.5)
#expect(normalControls.state.isRepeatEnabled)
#expect(normalControls.state.isAutoAdvanceEnabled)
#expect(normalControls.state === adaptiveControls.state)
}
@Test("Standalone adaptive buttons preserve Close and Info actions")
func adaptiveButtonsInvokeActions() throws {
var closed = false
var informationRequested = false
let moreButton = UIButton(type: .system)
let actions = NCMediaAdaptiveActionsView(
closeAction: UIAction { _ in closed = true },
moreButton: moreButton,
infoAction: UIAction { _ in informationRequested = true }
)
let closeButton = try #require(actions.arrangedSubviews.first as? UIButton)
let informationButton = try #require(actions.informationButton)
let visibleButtons = actions.arrangedSubviews.compactMap { $0 as? UIButton }.filter { !$0.isHidden }
#expect(visibleButtons.count == 3)
#expect(visibleButtons.contains { $0 === closeButton })
#expect(visibleButtons.contains { $0 === informationButton })
closeButton.sendActions(for: .touchUpInside)
informationButton.sendActions(for: .touchUpInside)
#expect(closed)
#expect(informationRequested)
#expect(actions.arrangedSubviews.last === moreButton)
#expect(!actions.arrangedSubviews.contains { $0 is UINavigationBar })
}
@Test("Reused or neighboring video covers cannot remove the selected cover actions")
func videoCoverActionsKeepTheirOwner() throws {
let state = NCMediaAdaptiveControlsState()
let oldOwner = UUID()
let currentOwner = UUID()
let neighborOwner = UUID()
var played: [String] = []
var cancelled = false
let oldControls = NCVideoPlaybackCoverPresentation(
isPlayEnabled: true,
isLoading: false,
isLaunchingPlayback: false,
statusMessage: nil,
onCancel: nil,
onPlay: { played.append("old") }
)
let currentControls = NCVideoPlaybackCoverPresentation(
isPlayEnabled: false,
isLoading: true,
isLaunchingPlayback: false,
statusMessage: "Downloading",
onCancel: { cancelled = true },
onPlay: { played.append("current") }
)
state.setVideoCoverControls(oldControls, for: "selected", owner: oldOwner)
state.setVideoCoverControls(currentControls, for: "selected", owner: currentOwner)
state.setVideoCoverControls(oldControls, for: "neighbor", owner: neighborOwner)
state.removeVideoCoverControls(for: "selected", owner: oldOwner)
state.removeVideoCoverControls(for: "neighbor", owner: neighborOwner)
let controls = try #require(state.videoCoverControls(for: "selected"))
#expect(controls.isLoading)
#expect(!controls.isPlayEnabled)
#expect(controls.statusMessage == "Downloading")
controls.onPlay()
controls.onCancel?()
#expect(played == ["current"])
#expect(cancelled)
#expect(state.videoCoverControls(for: "neighbor") == nil)
state.removeVideoCoverControls(for: "selected", owner: currentOwner)
#expect(state.videoCoverControls(for: "selected") == nil)
}
@Test("Media folding retains the paging host and uses independent controls", arguments: [NKTypeClassFile.image.rawValue, NKTypeClassFile.audio.rawValue])
func mediaFoldingPreservesPagingHost(classFile: String) throws {
let metadata = tableMetadata()
metadata.ocId = "image"
metadata.classFile = classFile
let model = NCMediaViewerModel(
currentMetadata: metadata,
ocIds: [metadata.ocId],
session: NCSession().getSession(account: ""),
loader: NCMediaViewerLoader()
)
let state = NCMediaAdaptiveControlsState()
let controller = NCMediaAdaptiveLayoutController(
mediaView: NCMediaViewerPagingView(
model: model,
contextMenuController: nil,
navigationBar: nil,
onVisibleMetadataChanged: { _ in },
onZoomChanged: { _ in },
onClose: { _ in }
),
normalControlsView: NCImageControlsView(model: model),
adaptiveControlsView: NCMediaAdaptiveControlsView(
model: model,
state: state,
makeActionsView: { UIView() }
),
onLayoutModeChanged: { _ in }
)
controller.loadViewIfNeeded()
let view = controller.layoutView
view.isLayoutEnabled = false
let mediaView = try #require(controller.mediaController.view)
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
view.layoutIfNeeded()
#expect(!view.isLayoutEnabled)
#expect(controller.adaptiveControlsController == nil)
view.isLayoutEnabled = true
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 280, width: 800, height: 40)])
let adaptiveController = try #require(controller.adaptiveControlsController)
#expect(adaptiveController.rootView.state === state)
#expect(adaptiveController.parent === controller)
#expect(mediaView.frame.height == 280)
#expect(controller.normalControlsController.view.superview?.isHidden == true)
// Updating the lower presentation must reach the retained host, not create a new one.
let updatedState = NCMediaAdaptiveControlsState()
controller.adaptiveControlsView = NCMediaAdaptiveControlsView(
model: model,
state: updatedState,
makeActionsView: { UIView() }
)
#expect(adaptiveController.rootView.state === updatedState)
#expect(controller.adaptiveControlsController === adaptiveController)
view.updateLayout(divisionFrames: [])
#expect(controller.mediaController.view === mediaView)
#expect(mediaView.frame == view.bounds)
#expect(controller.adaptiveControlsController === adaptiveController)
#expect(adaptiveController.view.isHidden)
#expect(controller.normalControlsController.view.superview?.isHidden == false)
}
@Test("A disabled container can be enabled and turned off again")
func experimentalLayoutRequiresEnabling() {
let videoView = UIView()
let normalControlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCMediaAdaptiveLayoutView(
mediaView: videoView,
normalControlsView: normalControlsView,
isLayoutEnabled: false,
adaptiveControlsView: { adaptiveControlsView }
)
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
let fold = CGRect(x: 0, y: 280, width: 800, height: 40)
var modes: [Bool] = []
view.onLayoutModeChanged = { modes.append($0) }
#expect(!view.isLayoutEnabled)
view.layoutIfNeeded()
view.updateLayout(divisionFrames: [fold])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(!normalControlsView.isHidden)
#expect(adaptiveControlsView.superview == nil)
#expect(view.subviews.count == 2)
#expect(!videoView.translatesAutoresizingMaskIntoConstraints)
#expect(!normalControlsView.translatesAutoresizingMaskIntoConstraints)
#expect(view.constraints.count == 8)
#expect(view.constraints.allSatisfy { $0.isActive })
#expect(modes.isEmpty)
view.isLayoutEnabled = true
view.updateLayout(divisionFrames: [fold])
#expect(view.isFoldedLayout)
#expect(normalControlsView.isHidden)
#expect(!adaptiveControlsView.isHidden)
view.isLayoutEnabled = false
view.layoutIfNeeded()
view.updateLayout(divisionFrames: [fold])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(!normalControlsView.isHidden)
#expect(adaptiveControlsView.isHidden)
#expect(modes == [true, false])
}
@Test("A container can start enabled without activating normal layout constraints")
func startsWithAdaptiveLayoutEnabled() {
let mediaView = UIView()
let normalControlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCMediaAdaptiveLayoutView(
mediaView: mediaView,
normalControlsView: normalControlsView,
isLayoutEnabled: true,
adaptiveControlsView: { adaptiveControlsView }
)
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
#expect(mediaView.translatesAutoresizingMaskIntoConstraints)
#expect(normalControlsView.translatesAutoresizingMaskIntoConstraints)
#expect(view.constraints.isEmpty)
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 280, width: 800, height: 40)])
#expect(view.isFoldedLayout)
#expect(mediaView.frame.height == 280)
#expect(adaptiveControlsView.frame.minY == 320)
view.isLayoutEnabled = false
view.layoutIfNeeded()
#expect(view.constraints.count == 8)
#expect(view.constraints.allSatisfy { $0.isActive })
#expect(!view.isFoldedLayout)
#expect(mediaView.frame == view.bounds)
}
@Test("Disabled mode does not create adaptive controls and preserves normal visibility")
func disabledModePreservesNormalControls() {
let videoView = UIView()
let normalControlsView = UIView()
var creationCount = 0
var modes: [Bool] = []
let view = NCMediaAdaptiveLayoutView(
mediaView: videoView,
normalControlsView: normalControlsView,
isLayoutEnabled: false,
adaptiveControlsView: {
creationCount += 1
return UIView()
}
)
view.onLayoutModeChanged = { modes.append($0) }
normalControlsView.isHidden = true
normalControlsView.alpha = 0
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
view.layoutIfNeeded()
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 280, width: 800, height: 40)])
#expect(creationCount == 0)
#expect(modes.isEmpty)
#expect(normalControlsView.isHidden)
#expect(normalControlsView.alpha == 0)
#expect(videoView.frame == view.bounds)
#expect(normalControlsView.frame == view.bounds)
normalControlsView.isHidden = false
normalControlsView.alpha = 1
view.frame = CGRect(x: 0, y: 0, width: 600, height: 800)
view.layoutIfNeeded()
#expect(creationCount == 0)
#expect(modes.isEmpty)
#expect(!normalControlsView.isHidden)
#expect(normalControlsView.alpha == 1)
#expect(videoView.frame == view.bounds)
#expect(normalControlsView.frame == view.bounds)
}
@Test("Folding and unfolding preserve the video surface and controls")
func foldingPreservesViews() {
let videoView = UIView()
let controlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCMediaAdaptiveLayoutView(
mediaView: videoView,
normalControlsView: controlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.isLayoutEnabled = true
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
var modes: [Bool] = []
view.onLayoutModeChanged = { modes.append($0) }
view.updateLayout(divisionFrames: [])
#expect(videoView.frame == view.bounds)
#expect(controlsView.frame == view.bounds)
let fold = CGRect(x: -10, y: 280, width: 820, height: 40)
view.updateLayout(divisionFrames: [fold])
#expect(view.isFoldedLayout)
#expect(videoView.frame == CGRect(x: 0, y: 0, width: 800, height: 280))
#expect(adaptiveControlsView.frame == CGRect(x: 0, y: 320, width: 800, height: 280))
#expect(controlsView.isHidden)
#expect(!adaptiveControlsView.isHidden)
view.updateLayout(divisionFrames: [fold])
#expect(modes == [true])
view.updateLayout(divisionFrames: [])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(controlsView.frame == view.bounds)
#expect(modes == [true, false])
#expect(!controlsView.isHidden)
#expect(adaptiveControlsView.isHidden)
#expect(view.subviews.count == 3)
#expect(view.subviews[0] === videoView)
#expect(view.subviews[1] === controlsView)
#expect(view.subviews[2] === adaptiveControlsView)
}
@Test("An enabled experiment creates lower controls only when a fold becomes active")
func unfoldedExperimentDoesNotCreateLowerControls() {
var creationCount = 0
let lowerControls = UIView()
let normalControls = UIView()
let view = NCMediaAdaptiveLayoutView(
mediaView: UIView(),
normalControlsView: normalControls,
isLayoutEnabled: true,
adaptiveControlsView: {
creationCount += 1
return lowerControls
}
)
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
view.updateLayout(divisionFrames: [])
view.updateLayout(divisionFrames: [CGRect(x: 380, y: 0, width: 40, height: 600)])
#expect(creationCount == 0)
#expect(!normalControls.isHidden)
let fold = CGRect(x: 0, y: 280, width: 800, height: 40)
view.updateLayout(divisionFrames: [fold])
view.updateLayout(divisionFrames: [])
view.updateLayout(divisionFrames: [fold])
#expect(creationCount == 1)
#expect(view.isFoldedLayout)
#expect(lowerControls.superview === view)
}
@Test("Enabled mode without a fold preserves normal chrome while resizing", arguments: [
CGSize(width: 390, height: 844),
CGSize(width: 844, height: 390),
CGSize(width: 1024, height: 1366),
CGSize(width: 420, height: 600)
])
func resizingWithoutFoldPreservesNormalChrome(size: CGSize) {
let mediaView = UIView()
let normalControls = UIView()
normalControls.isHidden = true
var creationCount = 0
var modes: [Bool] = []
let view = NCMediaAdaptiveLayoutView(
mediaView: mediaView,
normalControlsView: normalControls,
isLayoutEnabled: true,
adaptiveControlsView: {
creationCount += 1
return UIView()
}
)
view.onLayoutModeChanged = { modes.append($0) }
for boundsSize in [CGSize(width: 800, height: 600), size, CGSize(width: 800, height: 600)] {
view.frame = CGRect(origin: .zero, size: boundsSize)
view.updateLayout(divisionFrames: [])
#expect(mediaView.frame == view.bounds)
#expect(normalControls.frame == view.bounds)
#expect(normalControls.isHidden)
#expect(!view.isFoldedLayout)
}
#expect(creationCount == 0)
#expect(modes.isEmpty)
#expect(mediaView.superview === view)
#expect(normalControls.superview === view)
}
@Test("Unavailable adaptive controls preserve the normal layout and can recover")
func unavailableLowerControlsKeepNormalLayout() {
let mediaView = UIView()
let normalControls = UIView()
let lowerControls = UIView()
var available = false
var modes: [Bool] = []
let view = NCMediaAdaptiveLayoutView(
mediaView: mediaView,
normalControlsView: normalControls,
isLayoutEnabled: true,
adaptiveControlsView: { available ? lowerControls : nil }
)
view.onLayoutModeChanged = { modes.append($0) }
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
let fold = CGRect(x: 0, y: 280, width: 800, height: 40)
view.updateLayout(divisionFrames: [fold])
#expect(!view.isFoldedLayout)
#expect(mediaView.frame == view.bounds)
#expect(!normalControls.isHidden)
#expect(modes.isEmpty)
available = true
view.updateLayout(divisionFrames: [fold])
#expect(view.isFoldedLayout)
#expect(mediaView.frame.height == 280)
#expect(!lowerControls.isHidden)
#expect(normalControls.isHidden)
#expect(modes == [true])
}
@Test("Other regions retain the normal layout", arguments: [
CGRect(x: 380, y: 0, width: 40, height: 600),
CGRect(x: 0, y: 300, width: 800, height: 0),
CGRect(x: 0, y: 700, width: 800, height: 40),
CGRect(x: 0, y: 0, width: 800, height: 40),
CGRect(x: 0, y: 560, width: 800, height: 40),
CGRect(x: 200, y: 280, width: 100, height: 40)
])
func ignoresNonHorizontalDivisions(frame: CGRect) {
let videoView = UIView()
let controlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCMediaAdaptiveLayoutView(
mediaView: videoView,
normalControlsView: controlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.isLayoutEnabled = true
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
view.updateLayout(divisionFrames: [frame])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(controlsView.frame == view.bounds)
}
@Test("The layout follows changing fold geometry and view size")
func followsFoldGeometry() {
let videoView = UIView()
let controlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCMediaAdaptiveLayoutView(
mediaView: videoView,
normalControlsView: controlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.isLayoutEnabled = true
view.frame = CGRect(x: 0, y: 0, width: 600, height: 800)
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 370, width: 600, height: 60)])
#expect(videoView.frame == CGRect(x: 0, y: 0, width: 600, height: 370))
#expect(adaptiveControlsView.frame == CGRect(x: 0, y: 430, width: 600, height: 370))
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 350, width: 600, height: 100)])
#expect(videoView.frame.height == 350)
#expect(adaptiveControlsView.frame.minY == 450)
#expect(adaptiveControlsView.frame.height == 350)
}
}
@@ -1,219 +0,0 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
import UIKit
@testable import Nextcloud
@Suite("Adaptive video layout")
@MainActor
struct NCVideoAdaptiveLayoutViewTests {
@Test("Adaptive navigation belongs to a separate controls view")
func separateAdaptiveControls() throws {
let normalControls = NCVideoControlsView()
let adaptiveControls = NCVideoAdaptiveControlsView(state: normalControls.state)
let titleView = UIView()
let moreItem = UIBarButtonItem(title: "More", primaryAction: UIAction { _ in })
adaptiveControls.configureFoldedNavigation(
titleView: titleView,
closeAction: UIAction { _ in },
moreItem: moreItem
)
let item = try #require(adaptiveControls.foldedNavigationBar.topItem)
#expect(item.titleView === titleView)
#expect(item.leftBarButtonItem != nil)
#expect(item.rightBarButtonItem === moreItem)
#expect(adaptiveControls.foldedNavigationBar.superview === adaptiveControls)
#expect(!normalControls.subviews.contains { $0 is UINavigationBar })
normalControls.updateProgress(progress: 0.5, elapsedText: "1:00", remainingText: "−1:00")
adaptiveControls.updatePlaybackOptions(isRepeatEnabled: true, isAutoAdvanceEnabled: true)
#expect(adaptiveControls.state.progress == 0.5)
#expect(normalControls.state.isRepeatEnabled)
#expect(normalControls.state.isAutoAdvanceEnabled)
#expect(normalControls.state === adaptiveControls.state)
}
@Test("The experimental layout is disabled by default and can be turned off again")
func experimentalLayoutRequiresEnabling() {
let videoView = UIView()
let normalControlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCVideoAdaptiveLayoutView(
videoView: videoView,
normalControlsView: normalControlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
let fold = CGRect(x: 0, y: 280, width: 800, height: 40)
var modes: [Bool] = []
view.onLayoutModeChanged = { modes.append($0) }
#expect(!view.isAdaptiveLayoutEnabled)
view.layoutIfNeeded()
view.updateLayout(divisionFrames: [fold])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(!normalControlsView.isHidden)
#expect(adaptiveControlsView.superview == nil)
#expect(view.subviews.count == 2)
#expect(!videoView.translatesAutoresizingMaskIntoConstraints)
#expect(!normalControlsView.translatesAutoresizingMaskIntoConstraints)
#expect(view.constraints.count == 8)
#expect(view.constraints.allSatisfy(\.isActive))
#expect(modes.isEmpty)
view.isAdaptiveLayoutEnabled = true
view.updateLayout(divisionFrames: [fold])
#expect(view.isFoldedLayout)
#expect(normalControlsView.isHidden)
#expect(!adaptiveControlsView.isHidden)
view.isAdaptiveLayoutEnabled = false
view.layoutIfNeeded()
view.updateLayout(divisionFrames: [fold])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(!normalControlsView.isHidden)
#expect(adaptiveControlsView.isHidden)
#expect(modes == [true, false])
}
@Test("Disabled mode does not create adaptive controls and preserves normal visibility")
func disabledModePreservesNormalControls() {
let videoView = UIView()
let normalControlsView = UIView()
var creationCount = 0
var modes: [Bool] = []
let view = NCVideoAdaptiveLayoutView(
videoView: videoView,
normalControlsView: normalControlsView,
adaptiveControlsView: {
creationCount += 1
return UIView()
}
)
view.onLayoutModeChanged = { modes.append($0) }
normalControlsView.isHidden = true
normalControlsView.alpha = 0
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
view.layoutIfNeeded()
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 280, width: 800, height: 40)])
#expect(creationCount == 0)
#expect(modes.isEmpty)
#expect(normalControlsView.isHidden)
#expect(normalControlsView.alpha == 0)
#expect(videoView.frame == view.bounds)
#expect(normalControlsView.frame == view.bounds)
normalControlsView.isHidden = false
normalControlsView.alpha = 1
view.frame = CGRect(x: 0, y: 0, width: 600, height: 800)
view.layoutIfNeeded()
#expect(creationCount == 0)
#expect(modes.isEmpty)
#expect(!normalControlsView.isHidden)
#expect(normalControlsView.alpha == 1)
#expect(videoView.frame == view.bounds)
#expect(normalControlsView.frame == view.bounds)
}
@Test("Folding and unfolding preserve the video surface and controls")
func foldingPreservesViews() {
let videoView = UIView()
let controlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCVideoAdaptiveLayoutView(
videoView: videoView,
normalControlsView: controlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.isAdaptiveLayoutEnabled = true
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
var modes: [Bool] = []
view.onLayoutModeChanged = { modes.append($0) }
view.updateLayout(divisionFrames: [])
#expect(videoView.frame == view.bounds)
#expect(controlsView.frame == view.bounds)
let fold = CGRect(x: -10, y: 280, width: 820, height: 40)
view.updateLayout(divisionFrames: [fold])
#expect(view.isFoldedLayout)
#expect(videoView.frame == CGRect(x: 0, y: 0, width: 800, height: 280))
#expect(adaptiveControlsView.frame == CGRect(x: 0, y: 320, width: 800, height: 280))
#expect(controlsView.isHidden)
#expect(!adaptiveControlsView.isHidden)
view.updateLayout(divisionFrames: [fold])
#expect(modes == [true])
view.updateLayout(divisionFrames: [])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(controlsView.frame == view.bounds)
#expect(modes == [true, false])
#expect(!controlsView.isHidden)
#expect(adaptiveControlsView.isHidden)
#expect(view.subviews.count == 3)
#expect(view.subviews[0] === videoView)
#expect(view.subviews[1] === controlsView)
#expect(view.subviews[2] === adaptiveControlsView)
}
@Test("Other regions retain the normal layout", arguments: [
CGRect(x: 380, y: 0, width: 40, height: 600),
CGRect(x: 0, y: 300, width: 800, height: 0),
CGRect(x: 0, y: 700, width: 800, height: 40),
CGRect(x: 0, y: 0, width: 800, height: 40),
CGRect(x: 0, y: 560, width: 800, height: 40),
CGRect(x: 200, y: 280, width: 100, height: 40)
])
func ignoresNonHorizontalDivisions(frame: CGRect) {
let videoView = UIView()
let controlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCVideoAdaptiveLayoutView(
videoView: videoView,
normalControlsView: controlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.isAdaptiveLayoutEnabled = true
view.frame = CGRect(x: 0, y: 0, width: 800, height: 600)
view.updateLayout(divisionFrames: [frame])
#expect(!view.isFoldedLayout)
#expect(videoView.frame == view.bounds)
#expect(controlsView.frame == view.bounds)
}
@Test("The layout follows changing fold geometry and view size")
func followsFoldGeometry() {
let videoView = UIView()
let controlsView = UIView()
let adaptiveControlsView = UIView()
let view = NCVideoAdaptiveLayoutView(
videoView: videoView,
normalControlsView: controlsView,
adaptiveControlsView: { adaptiveControlsView }
)
view.isAdaptiveLayoutEnabled = true
view.frame = CGRect(x: 0, y: 0, width: 600, height: 800)
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 370, width: 600, height: 60)])
#expect(videoView.frame == CGRect(x: 0, y: 0, width: 600, height: 370))
#expect(adaptiveControlsView.frame == CGRect(x: 0, y: 430, width: 600, height: 370))
view.updateLayout(divisionFrames: [CGRect(x: 0, y: 350, width: 600, height: 100)])
#expect(videoView.frame.height == 350)
#expect(adaptiveControlsView.frame.minY == 450)
#expect(adaptiveControlsView.frame.height == 350)
}
}
+29 -1
View File
@@ -14,6 +14,12 @@ class AlbumsViewController: UIViewController {
private(set) var detailsViewModel: AlbumDetailsViewModel?
private var cancellables: Set<AnyCancellable> = []
private var hostingController: UIHostingController<AnyView>?
internal lazy var serverDataActivityIndicator: UIActivityIndicatorView = {
let indicator = UIActivityIndicatorView(style: .medium)
indicator.hidesWhenStopped = true
return indicator
}()
internal lazy var serverDataActivityBarButtonItem = UIBarButtonItem(customView: serverDataActivityIndicator)
private var controller: NCMainTabBarController? {
tabBarController as? NCMainTabBarController
}
@@ -21,6 +27,9 @@ class AlbumsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Preserve SwiftUI's native refresh gesture; only its visual indicator is suppressed here.
UIRefreshControl.appearance(whenContainedInInstancesOf: [AlbumsViewController.self]).tintColor = .clear
// Needed, since we use NCViewerMediaPage to show the media, which expects this!
navigationController?.navigationBar.prefersLargeTitles = false
@@ -86,8 +95,9 @@ class AlbumsViewController: UIViewController {
listViewModel = nil
viewModel.$screenTitle.combineLatest(viewModel.$isLoading)
.receive(on: DispatchQueue.main)
.sink { [weak self] _ in
.sink { [weak self] _, isLoading in
guard let self else { return }
self.setServerDataLoading(isLoading)
NCAlbumsNavigationController.configureNavigationItems(for: self)
}
.store(in: &cancellables)
@@ -96,6 +106,12 @@ class AlbumsViewController: UIViewController {
let viewModel = AlbumsListViewModel(controller: controller, navigator: navigator)
listViewModel = viewModel
detailsViewModel = nil
AlbumsManager.shared.loadingAccounts
.map { $0.contains(account) }
.removeDuplicates()
.receive(on: DispatchQueue.main)
.sink { [weak self] isLoading in self?.setServerDataLoading(isLoading) }
.store(in: &cancellables)
rootView = AnyView(AlbumsListScreen(controller: controller, viewModel: viewModel))
}
NCAlbumsNavigationController.configureNavigationItems(for: self)
@@ -140,6 +156,18 @@ class AlbumsViewController: UIViewController {
AlbumsManager.shared.syncAlbums(for: account)
}
}
private func setServerDataLoading(_ isLoading: Bool) {
if isLoading {
serverDataActivityIndicator.startAnimating()
} else {
serverDataActivityIndicator.stopAnimating()
}
if navigationController?.topViewController === self {
(navigationController as? NCMainNavigationController)?.configureSidebarButton()
}
}
}
struct AccountKey: EnvironmentKey {
+8 -1
View File
@@ -16,6 +16,8 @@ final class AlbumsManager: @unchecked Sendable {
@MainActor private var photoSyncTasks: [String: Task<Void, Never>] = [:]
@MainActor private var photoRequests: [String: (id: UUID, task: Task<Void, Error>)] = [:]
@MainActor private var albumRequests: [String: UUID] = [:]
/// Listing activity is separate from cached results so refreshes can keep their content visible.
@MainActor let loadingAccounts = CurrentValueSubject<Set<String>, Never>([])
// Successful server renames awaiting an authoritative album-list response.
@MainActor private var pendingRenames: [String: [String: String]] = [:]
@@ -40,9 +42,13 @@ final class AlbumsManager: @unchecked Sendable {
let request = UUID()
albumRequests[account] = request
loadingAccounts.send(loadingAccounts.value.union([account]))
photoSyncTasks[account]?.cancel()
defer {
if albumRequests[account] == request { albumRequests[account] = nil }
if albumRequests[account] == request {
albumRequests[account] = nil
loadingAccounts.send(loadingAccounts.value.subtracting([account]))
}
}
do {
@@ -162,6 +168,7 @@ final class AlbumsManager: @unchecked Sendable {
// Called after a successful edit: a list response started before that edit
// must not restore a deleted album or its old name/count.
albumRequests[album.account] = nil
loadingAccounts.send(loadingAccounts.value.subtracting([album.account]))
photoRequests[album.id]?.task.cancel()
photoRequests[album.id] = nil
}
@@ -6,10 +6,10 @@ import UIKit
/// Shares the app's navigation appearance and sidebar behavior with Files and Media.
class NCAlbumsNavigationController: NCMainNavigationController {
override func collectionViewCommonTrailingItemGroups() async {
override func updateNavigationMenu() async {
// Album screens provide their own creation and editing actions.
guard !(topViewController is AlbumsViewController) else { return }
await super.collectionViewCommonTrailingItemGroups()
await super.updateNavigationMenu()
}
static func configureNavigationItems(for screen: AlbumsViewController) {
@@ -17,6 +17,7 @@ struct AlbumDetailsScreen: View {
var body: some View {
ZStack {
content()
.scrollBounceBehavior(.always, axes: .vertical)
if viewModel.isLoadingPopupVisible {
NCLoadingAlert()
@@ -75,19 +76,18 @@ struct AlbumDetailsScreen: View {
@ViewBuilder
private func content() -> some View {
if viewModel.isLoading && !viewModel.hasCachedPhotos {
ProgressView(NSLocalizedString("_albums_photos_loading_msg_", comment: ""))
Color.clear.frame(maxWidth: .infinity, maxHeight: .infinity)
} else if let error = viewModel.errorMessage {
Text(error)
.refreshable {
viewModel.onPulledToRefresh()
}
ScrollView {
Text(error)
.frame(maxWidth: .infinity)
}
.refreshable { viewModel.onPulledToRefresh() }
} else if viewModel.photos.isEmpty {
NoPhotosEmptyView(
onAddPhotosIntent: handleAddPhotosIntent
)
.refreshable {
viewModel.onPulledToRefresh()
}
.refreshable { viewModel.onPulledToRefresh() }
} else {
PhotosGridView(
controller: controller,
@@ -99,9 +99,7 @@ struct AlbumDetailsScreen: View {
}
}
)
.refreshable {
viewModel.onPulledToRefresh()
}
.refreshable { viewModel.onPulledToRefresh() }
}
}
@@ -8,6 +8,7 @@ import SwiftUI
struct AlbumGridItemView: View {
let album: Album
@Environment(\.localAccount) var localAccount: String
@Environment(\.displayScale) private var displayScale
private enum ImageState { case loading, empty, thumbnail(UIImage) }
@State private var imageState: ImageState = .empty
@@ -114,7 +115,7 @@ struct AlbumGridItemView: View {
)
.stroke(
Color.gray.opacity(1),
lineWidth: 1 / UIScreen.main.scale
lineWidth: 1 / max(displayScale, 1)
)
}
}
@@ -17,6 +17,7 @@ struct AlbumsListScreen: View {
var body: some View {
ZStack {
content()
.scrollBounceBehavior(.always, axes: .vertical)
if viewModel.isLoadingPopupVisible {
NCLoadingAlert()
@@ -48,8 +49,8 @@ struct AlbumsListScreen: View {
@ViewBuilder
private func content() -> some View {
if viewModel.isLoading {
ProgressView(NSLocalizedString("_albums_list_loading_msg_", comment: ""))
if viewModel.isLoading && viewModel.albums.isEmpty {
Color.clear.frame(maxWidth: .infinity, maxHeight: .infinity)
} else if let error = viewModel.errorMessage {
ScrollView(.vertical) {
VStack {
@@ -58,14 +59,10 @@ struct AlbumsListScreen: View {
Spacer()
}
}
.refreshable {
viewModel.onPulledToRefresh()
}
.refreshable { viewModel.onPulledToRefresh() }
} else if viewModel.albums.isEmpty {
NoAlbumsEmptyView(onNewAlbumCreationIntent: viewModel.onNewAlbumClick)
.refreshable {
viewModel.onPulledToRefresh()
}
.refreshable { viewModel.onPulledToRefresh() }
} else {
AlbumsGridView(
albums: viewModel.albums.sorted { (lhs: Album, rhs: Album) -> Bool in
@@ -75,9 +72,7 @@ struct AlbumsListScreen: View {
},
onAlbumClicked: viewModel.onAlbumClicked
)
.refreshable {
viewModel.onPulledToRefresh()
}
.refreshable { viewModel.onPulledToRefresh() }
}
}
}
+11 -3
View File
@@ -23,7 +23,7 @@ class tableAccount: Object {
@objc dynamic var autoUploadVideo: Bool = false
@objc dynamic var autoUploadWWAnPhoto: Bool = false
@objc dynamic var autoUploadWWAnVideo: Bool = false
/// Incremental restart date; nil scans the whole library. Advances only past confirmed uploads.
/// Confirmed upload progress; also the lower bound for discovery when whole-library mode is off.
@objc dynamic var autoUploadSinceDate: Date?
/// Preserves the whole-library selection independently of incremental progress.
@objc dynamic var autoUploadAllPhotos = false
@@ -62,6 +62,12 @@ class tableAccount: Object {
@objc dynamic var userStatusStatusIsUserDefined: Bool = false
@objc dynamic var website = ""
/// Shared by app and PhotoKit discovery. Progress must never restrict a whole-library scan.
var autoUploadDatePredicate: NSPredicate? {
guard !autoUploadAllPhotos, let autoUploadSinceDate else { return nil }
return NSPredicate(format: "creationDate >= %@", autoUploadSinceDate as NSDate)
}
override static func primaryKey() -> String {
return "account"
}
@@ -407,13 +413,15 @@ extension NCManageDatabase {
}
}
/// Selecting the whole library preserves the date until the next Start.
/// Selecting the whole library clears the previous date immediately.
func setAutoUploadAllPhotosAsync(_ allPhotos: Bool, account: String) async {
await core.performRealmWriteAsync { realm in
guard let current = realm.objects(tableAccount.self).filter("account == %@", account).first,
!current.autoUploadStart else { return }
current.autoUploadAllPhotos = allPhotos
if !allPhotos, current.autoUploadSinceDate == nil {
if allPhotos {
current.autoUploadSinceDate = nil
} else if current.autoUploadSinceDate == nil {
current.autoUploadSinceDate = Date.now
}
}
+1 -1
View File
@@ -172,7 +172,7 @@ extension UIImage {
/// - pointSize: The target point size
/// - scale: The point to pixel scale (Pixeld per point)
/// - Returns: The downsampled image, if successful
static func downsample(imageAt imageURL: URL, to pointSize: CGSize, scale: CGFloat = UIScreen.main.scale) -> UIImage? {
static func downsample(imageAt imageURL: URL, to pointSize: CGSize, scale: CGFloat) -> UIImage? {
// Create an CGImageSource that represent an image
let imageSourceOptions = [kCGImageSourceShouldCache: false] as CFDictionary
+98 -7
View File
@@ -9,6 +9,10 @@ import SwiftUI
class NCFiles: NCCollectionViewCommon {
private var dataSourceTask: URLSessionTask?
private var folderPollingTask: Task<Void, Never>?
private var folderPollingNetworkTask: URLSessionTask?
// Prevent polling from starting another refresh while server data is loading.
private var serverDataRequests = 0
internal var lastOffsetY: CGFloat = 0
internal var lastScrollTime: TimeInterval = 0
internal var accumulatedScrollDown: CGFloat = 0
@@ -44,8 +48,15 @@ class NCFiles: NCCollectionViewCommon {
}
}
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: .main) { [weak self] _ in
Task { @MainActor in
self?.startFolderPolling()
}
}
NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: nil) { _ in
Task {
Task { @MainActor in
self.stopFolderPolling()
await self.stopSyncMetadata()
await self.searchOperationHandle.cancel()
}
@@ -124,6 +135,7 @@ class NCFiles: NCCollectionViewCommon {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
startFolderPolling()
Task {
// (+)
@@ -138,15 +150,78 @@ class NCFiles: NCCollectionViewCommon {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
dataSourceTask?.cancel()
dataSourceTask = nil
stopFolderPolling()
Task {
await stopSyncMetadata()
}
}
// MARK: - Folder polling
/// Checks the folder every 30 seconds while this is the current Files controller.
/// Called when the view appears or the app becomes active; duplicate starts are ignored.
private func startFolderPolling() {
guard folderPollingTask == nil, viewIfLoaded?.window != nil, controller?.currentViewController() === self else { return }
folderPollingTask = Task { @MainActor [weak self] in
while !Task.isCancelled {
do {
try await Task.sleep(for: .seconds(30))
} catch {
return
}
guard let self else { return }
await self.pollFolder()
}
}
}
/// Stops polling and cancels folder requests when leaving the view or entering background.
private func stopFolderPolling() {
folderPollingTask?.cancel()
folderPollingTask = nil
folderPollingNetworkTask?.cancel()
folderPollingNetworkTask = nil
dataSourceTask?.cancel()
dataSourceTask = nil
}
/// Reads only the folder metadata and reuses the existing refresh when its ETag changes.
private func pollFolder() async {
// Skip this cycle while the window is inactive or the user is interacting with the list.
guard viewIfLoaded?.window?.windowScene?.activationState == .foregroundActive,
presentedViewController == nil, !isSearchingMode, !isEditMode, serverDataRequests == 0,
!collectionView.isTracking, !collectionView.isDecelerating else { return }
let account = session.account
let serverUrl = self.serverUrl
let directory = await database.getTableDirectoryAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl))
let etag = directory?.etag
// Keep this cycle's task so a late network callback cannot attach to a restarted loop.
let pollingTask = folderPollingTask
guard !Task.isCancelled else { return }
let result = await networking.readFileAsync(serverUrlFileName: serverUrl, account: account) { task in
Task { @MainActor in
// Cancelling the Swift task does not automatically cancel the HTTP request.
if pollingTask?.isCancelled == true {
task.cancel()
} else {
self.folderPollingNetworkTask = task
}
}
}
// The account, folder or search mode may have changed while awaiting the response.
guard !Task.isCancelled, account == session.account, serverUrl == self.serverUrl,
viewIfLoaded?.window?.windowScene?.activationState == .foregroundActive,
presentedViewController == nil, !isSearchingMode, !isEditMode, serverDataRequests == 0,
!collectionView.isTracking, !collectionView.isDecelerating,
result.error == .success, let metadata = result.metadata, metadata.etag != etag else { return }
// The existing refresh checks the ETag again before reading the folder contents.
await getServerData()
}
// MARK: - DataSource
override func reloadDataSource() async {
@@ -179,9 +254,13 @@ class NCFiles: NCCollectionViewCommon {
}
override func getServerData(forced: Bool = false) async {
serverDataRequests += 1
defer {
serverDataRequests -= 1
stopGUIGetServerData()
startSyncMetadata(metadatas: self.dataSource.getMetadatas())
if !Task.isCancelled {
startSyncMetadata(metadatas: self.dataSource.getMetadatas())
}
}
dataSourceTask?.cancel()
@@ -198,7 +277,7 @@ class NCFiles: NCCollectionViewCommon {
let effectiveForced = forced || hasPlaceholder
let resultsReadFolder = await networkReadFolderAsync(serverUrl: self.serverUrl, forced: effectiveForced)
guard resultsReadFolder.error == .success, resultsReadFolder.reloadRequired else {
guard !Task.isCancelled, resultsReadFolder.error == .success, resultsReadFolder.reloadRequired else {
return
}
@@ -237,10 +316,17 @@ class NCFiles: NCCollectionViewCommon {
}
private func networkReadFolderAsync(serverUrl: String, forced: Bool) async -> (metadatas: [tableMetadata]?, error: NKError, reloadRequired: Bool) {
guard !Task.isCancelled else { return (nil, .success, false) }
var reloadRequired: Bool = false
let account = session.account
let pollingTask = folderPollingTask
let resultsReadFile = await NCNetworking.shared.readFileAsync(serverUrlFileName: serverUrl, account: account) { task in
Task { @MainActor in
// The request callback can arrive after the polling cycle was stopped.
guard pollingTask?.isCancelled != true else {
task.cancel()
return
}
self.dataSourceTask = task
if self.dataSource.isEmpty() {
@@ -258,6 +344,7 @@ class NCFiles: NCCollectionViewCommon {
await self.database.updateDirectoryRichWorkspaceAsync(metadata.richWorkspace, account: account, serverUrl: serverUrl)
let tableDirectory = await self.database.getTableDirectoryAsync(ocId: metadata.ocId)
guard !Task.isCancelled else { return (nil, .success, false) }
// Verify LivePhoto
//
reloadRequired = await networking.setLivePhoto(account: account)
@@ -283,6 +370,10 @@ class NCFiles: NCCollectionViewCommon {
options: options
) { task in
Task { @MainActor in
guard pollingTask?.isCancelled != true else {
task.cancel()
return
}
self.dataSourceTask = task
if self.dataSource.isEmpty() {
@@ -291,7 +382,7 @@ class NCFiles: NCCollectionViewCommon {
}
}
guard resultsReadFolder.error == .success else {
guard !Task.isCancelled, resultsReadFolder.error == .success else {
return(nil, resultsReadFolder.error, reloadRequired)
}
reloadRequired = true
+2 -2
View File
@@ -313,9 +313,9 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
vc.dismissDidEnterBackground = false
vc.delegate = self
let screenHeighMax = UIScreen.main.bounds.height - (UIScreen.main.bounds.height / 5)
let maximumHeight = view.safeAreaLayoutGuide.layoutFrame.height * 0.8
let numberCell = shareAccounts.count
let height = min(CGFloat(numberCell * Int(vc.heightCell) + 45), screenHeighMax)
let height = min(CGFloat(numberCell * Int(vc.heightCell) + 45), maximumHeight)
let popup = NCPopupViewController(contentController: vc, popupWidth: 300, popupHeight: height + 20)
self.present(popup, animated: true)
@@ -39,6 +39,8 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellMainP
weak var delegate: NCListCellDelegate?
private var favoriteOutlineView: UIImageView?
// Cell Protocol
var metadata: tableMetadata? {
didSet {
@@ -103,6 +105,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellMainP
imageItem.layer.masksToBounds = true
imageStatus.image = nil
imageFavorite.image = nil
favoriteOutlineView?.isHidden = true
imageLocal.image = nil
buttonShared.setImage(nil, for: .normal)
@@ -337,7 +340,8 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellMainP
imageView.makeCircularBackground(withColor: imageView.image != nil ? .systemBackground : .clear)
}
if imageFavorite.image != nil {
// Keep one outline and its constraints across cell reuse.
if imageFavorite.image != nil, favoriteOutlineView == nil {
let outlineView = UIImageView()
outlineView.translatesAutoresizingMaskIntoConstraints = false
outlineView.image = UIImage(systemName: "star")
@@ -352,11 +356,10 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellMainP
outlineView.bottomAnchor.constraint(equalTo: imageFavorite.bottomAnchor, constant: 1)
])
imageFavorite.sendSubviewToBack(outlineView)
} else {
imageFavorite.subviews.forEach { view in
view.removeFromSuperview()
}
favoriteOutlineView = outlineView
}
favoriteOutlineView?.isHidden = imageFavorite.image == nil
}
override func layoutSubviews() {
@@ -2,15 +2,34 @@
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
extension NCCollectionViewCommon: NCListCellDelegate, NCGridCellDelegate {
func openContextMenu(with metadata: tableMetadata?, button: UIButton, sender: Any) {
Task {
guard let metadata else { return }
button.menu = NCContextMenuMain(metadata: metadata,
viewController: self,
controller: self.controller,
sender: sender).viewMenu()
guard let metadata else {
button.menu = nil
return
}
let ocId = metadata.ocId
let account = metadata.account
// Resolve actions only when the menu opens, rather than for every cell while scrolling.
let deferredMenu = UIDeferredMenuElement.uncached { [weak self, weak senderView = sender as? UIView] completion in
Task { @MainActor in
guard let self,
let cell = senderView as? NCCellMainProtocol,
let currentMetadata = cell.metadata,
currentMetadata.ocId == ocId,
currentMetadata.account == account else {
completion([])
return
}
let menu = NCContextMenuMain(metadata: currentMetadata, viewController: self, controller: self.controller, sender: senderView).viewMenu()
completion(menu.children)
}
}
button.menu = UIMenu(children: [deferredMenu])
}
func onMenuIntent(with metadata: tableMetadata?) {
@@ -28,6 +28,12 @@ class NCCollectionViewCommon: UIViewController, NCAccountSettingsModelDelegate,
internal var autoUploadFileName = ""
internal var autoUploadDirectory = ""
internal let refreshControl = UIRefreshControl()
internal lazy var serverDataActivityIndicator: UIActivityIndicatorView = {
let indicator = UIActivityIndicatorView(style: .medium)
indicator.hidesWhenStopped = true
return indicator
}()
internal lazy var serverDataActivityBarButtonItem = UIBarButtonItem(customView: serverDataActivityIndicator)
internal var searchController: UISearchController?
internal var backgroundImageView = UIImageView()
internal var serverUrl: String = ""
@@ -95,10 +101,7 @@ class NCCollectionViewCommon: UIViewController, NCAccountSettingsModelDelegate,
internal var lastScale: CGFloat = 1.0
internal var currentScale: CGFloat = 1.0
internal var maxColumns: Int {
let screenWidth = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
let column = Int(screenWidth / 55)
return column
max(1, Int(collectionView.bounds.width / 55))
}
internal var transitionColumns = false
internal var numberOfColumns: Int = 0
@@ -377,6 +380,7 @@ class NCCollectionViewCommon: UIViewController, NCAccountSettingsModelDelegate,
} else {
collectionView.collectionViewLayout.invalidateLayout()
}
sectionFirstHeader?.viewRichWorkspaceHeightConstraint.constant = getHeaderHeight(section: 0).heightHeaderRichWorkspace
sectionFirstHeader?.setNeedsLayout()
}
@@ -510,26 +514,19 @@ class NCCollectionViewCommon: UIViewController, NCAccountSettingsModelDelegate,
return
}
let spinner = UIActivityIndicatorView(style: .medium)
spinner.startAnimating()
let container = UIView()
container.translatesAutoresizingMaskIntoConstraints = false
container.addSubview(spinner)
spinner.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
spinner.centerXAnchor.constraint(equalTo: container.centerXAnchor),
spinner.centerYAnchor.constraint(equalTo: container.centerYAnchor)
])
self.navigationItem.titleView = container
serverDataActivityIndicator.startAnimating()
if navigationController?.topViewController === self {
(navigationController as? NCMainNavigationController)?.configureSidebarButton()
}
}
@MainActor
func stopGUIGetServerData() {
self.dataSource.setGetServerData(true)
self.navigationItem.titleView = nil
serverDataActivityIndicator.stopAnimating()
if navigationController?.topViewController === self {
(navigationController as? NCMainNavigationController)?.configureSidebarButton()
}
self.navigationItem.title = self.titleCurrentFolder
}
@@ -590,6 +587,26 @@ class NCCollectionViewCommon: UIViewController, NCAccountSettingsModelDelegate,
}
}
func didPresentSearchController(_ searchController: UISearchController) {
updateSearchNavigationLayout()
}
func didDismissSearchController(_ searchController: UISearchController) {
updateSearchNavigationLayout()
}
private func updateSearchNavigationLayout() {
if #available(iOS 26.0, *) { return }
guard let navigationController = mainNavigationController,
navigationController.topViewController === self else { return }
// Refresh inline-search/overflow sizing after UIKit completes its presentation transition.
navigationController.configureSidebarButton()
navigationController.navigationBar.invalidateIntrinsicContentSize()
navigationController.navigationBar.setNeedsLayout()
navigationController.view.setNeedsLayout()
navigationController.view.layoutIfNeeded()
}
func willDismissSearchController(_ searchController: UISearchController) {
self.isSearchingMode = false
self.networkSearchInProgress = false
@@ -735,7 +752,7 @@ class NCCollectionViewCommon: UIViewController, NCAccountSettingsModelDelegate,
!isSearchingMode,
let richWorkspaceText = self.richWorkspaceText,
!richWorkspaceText.trimmingCharacters(in: .whitespaces).isEmpty {
heightHeaderRichWorkspace = UIScreen.main.bounds.size.height / 6
heightHeaderRichWorkspace = collectionView.bounds.height / 6
}
if isRecommendationActived,
@@ -390,11 +390,11 @@ extension NCSectionFirstHeader: UICollectionViewDelegate {
return nil
#else
return UIContextMenuConfiguration(identifier: identifier, previewProvider: {
return NCViewerProviderContextMenu(metadata: metadata, image: image, sceneIdentifier: self.sceneIdentifier)
return NCViewerProviderContextMenu(metadata: metadata, image: image, sceneIdentifier: self.sceneIdentifier, sourceView: viewController.view)
}, actionProvider: { _ in
let cell = collectionView.cellForItem(at: indexPath)
let contextMenu = NCContextMenuMain(metadata: metadata.detachedCopy(), viewController: viewController, controller: self.controller, sender: cell)
return contextMenu.viewMenu()
return contextMenu.viewMenu(showViewInFolder: true)
})
#endif
}
@@ -415,7 +415,7 @@ extension NCSectionFirstHeader: NCRecommendationsCellDelegate {
button.menu = nil
return
}
button.menu = NCContextMenuMain(metadata: metadata, viewController: viewController, controller: self.controller, sender: sender).viewMenu()
button.menu = NCContextMenuMain(metadata: metadata, viewController: viewController, controller: self.controller, sender: sender).viewMenu(showViewInFolder: true)
#endif
}
@@ -335,7 +335,7 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
fileName: metadataAlreadyExists.fileNameView,
userId: metadataAlreadyExists.userId,
urlBase: metadataAlreadyExists.urlBase))
if let image = utility.pdfThumbnail(url: url) {
if let image = utility.pdfThumbnail(url: url, scale: cell.imageAlreadyExistingFile.traitCollection.displayScale) {
cell.imageAlreadyExistingFile.image = image
} else {
cell.imageAlreadyExistingFile.image = UIImage(named: metadataAlreadyExists.iconName)
@@ -445,7 +445,11 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
do {
if metadataNewFile.classFile == NKTypeClassFile.image.rawValue {
// preserver memory especially for very large files in Share extension
if let image = UIImage.downsample(imageAt: URL(fileURLWithPath: filePathNewFile), to: cell.imageNewFile.frame.size) {
if let image = UIImage.downsample(
imageAt: URL(fileURLWithPath: filePathNewFile),
to: cell.imageNewFile.frame.size,
scale: cell.imageNewFile.traitCollection.displayScale
) {
cell.imageNewFile.image = image
}
}
+89 -155
View File
@@ -38,8 +38,6 @@ class NCMainNavigationController: UINavigationController, UINavigationController
let menuNavigation = NCContextMenuNavigation()
var menuPlus: NCContextMenuPlus?
let optionButtonTag = 100
lazy var sidebarButtonItem: UIBarButtonItem = {
let action = UIAction(title: NSLocalizedString("_sidebar_navigation_", comment: ""), image: UIImage(systemName: "sidebar.left")) { [weak self] _ in
self?.controller?.presentSidebar()
@@ -57,11 +55,15 @@ class NCMainNavigationController: UINavigationController, UINavigationController
return item
}()
lazy var optionButtonItem: UIBarButtonItem = {
let item = UIBarButtonItem()
item.tag = optionButtonTag
return item
}()
private var isEditingContent: Bool {
(collectionViewCommon?.isEditMode ?? false) || (trashViewController?.isEditMode ?? false) || (mediaViewController?.isEditMode ?? false)
}
private var leadingItems: [UIBarButtonItem] {
guard let navigationItem = topViewController?.navigationItem else { return [] }
let items = navigationItem.leadingItemGroups.flatMap { $0.barButtonItems }
return items.isEmpty ? navigationItem.leftBarButtonItems ?? [] : items
}
// MARK: - View Life Cycle
@@ -72,13 +74,13 @@ class NCMainNavigationController: UINavigationController, UINavigationController
setNavigationBarAppearance()
setNavigationBarHidden(false, animated: true)
Task {
optionButtonItem.image = UIImage(systemName: "ellipsis")
optionButtonItem.tintColor = NCBrandColor.shared.iconImageColor
setOptionMenu(await createOptionMenu())
}
configurePlusButton()
observeNotifications()
}
// PLUS BUTTON MENU
// MARK: - Plus Button
private func configurePlusButton() {
let buttonSize: CGFloat = 44
let plusConfiguration = UIImage.SymbolConfiguration(pointSize: 18, weight: .regular)
let plusImage = UIImage(systemName: "plus", withConfiguration: plusConfiguration)?.withRenderingMode(.alwaysTemplate)
@@ -106,21 +108,22 @@ class NCMainNavigationController: UINavigationController, UINavigationController
view.addSubview(menuPlusButton)
let trailingAnchor: CGFloat = UIDevice.current.userInterfaceIdiom == .pad ? -28 : -22
let bottomAnchor: CGFloat = UIDevice.current.userInterfaceIdiom == .pad ? -28 : -22
NSLayoutConstraint.activate([
menuPlusButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: trailingAnchor),
menuPlusButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: bottomAnchor),
menuPlusButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -20),
menuPlusButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -20),
menuPlusButton.widthAnchor.constraint(equalToConstant: buttonSize),
menuPlusButton.heightAnchor.constraint(equalToConstant: buttonSize)
])
menuPlus = NCContextMenuPlus(menuPlusButton: menuPlusButton, controller: controller)
}
// MARK: - Notifications
private func observeNotifications() {
// CAPABILITIES UPDATE
//
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: self.global.notificationCenterServerDidUpdate), object: nil, queue: nil) { [weak self] notification in
let serverUpdate = Notification.Name(global.notificationCenterServerDidUpdate)
NotificationCenter.default.addObserver(forName: serverUpdate, object: nil, queue: nil) { [weak self] notification in
guard let userInfo = notification.userInfo,
let account = userInfo["account"] as? String else {
return
@@ -137,9 +140,7 @@ class NCMainNavigationController: UINavigationController, UINavigationController
guard controller.account == account else { return }
let session = NCSession.shared.getSession(account: account)
// Notification
//
if capabilities.notification.count == 0 {
if capabilities.notification.isEmpty {
controller.availableNotifications = false
} else {
_ = await NextcloudKit.shared.getNotificationsAsync(account: account)
@@ -147,39 +148,39 @@ class NCMainNavigationController: UINavigationController, UINavigationController
controller.availableNotifications = true
}
guard controller.account == account else { return }
await self.collectionViewCommonTrailingItemGroups()
// (+)
await self.updateNavigationMenu()
await self.menuPlus?.create(session: session)
}
}
// REACHABILITY
//
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: self.global.notificationCenterNetworkReachability), object: nil, queue: .main) { [weak self] _ in
let reachability = Notification.Name(global.notificationCenterNetworkReachability)
NotificationCenter.default.addObserver(forName: reachability, object: nil, queue: .main) { [weak self] _ in
Task { @MainActor [weak self] in
guard let self else { return }
// (+)
await self.menuPlus?.create(session: session)
}
}
}
// MARK: - Navigation
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
if #available(iOS 27.0, *),
viewController is NCCollectionViewCommon || viewController is NCMedia || viewController is AlbumsViewController ||
viewController is NCTrash || viewController is NCActivity || viewController is UIHostingController<TransfersView> {
viewController.navigationItem.navigationBarMinimization.minimizationBehavior = .never
}
Task { @MainActor in
// (+)
// PLUS BUTTON ONLY IN FILES
if let viewController = viewController as? NCFiles {
self.menuPlus?.hiddenPlusButton(isEditMode: viewController.isEditMode,
isSearchingMode: viewController.isSearchingMode,
animation: false)
menuPlus?.hiddenPlusButton(isEditMode: viewController.isEditMode, isSearchingMode: viewController.isSearchingMode, animation: false)
} else {
self.menuPlus?.hiddenPlusButton(true,
animation: false)
menuPlus?.hiddenPlusButton(true, animation: false)
}
// MENU
setNavigationBarAppearance()
await collectionViewCommonTrailingItemGroups()
await updateNavigationMenu()
configureSidebarButton()
}
}
@@ -188,58 +189,29 @@ class NCMainNavigationController: UINavigationController, UINavigationController
@MainActor
func setNavigationRightItems() async {
// COLLECTION EDIT MODE
if let collectionViewCommon, collectionViewCommon.isEditMode {
collectionViewCommon.tabBarSelect?.update(
fileSelect: collectionViewCommon.fileSelect,
metadatas: collectionViewCommon.getSelectedMetadatas(),
userId: session.userId
)
collectionViewCommon.tabBarSelect?.update(fileSelect: collectionViewCommon.fileSelect, metadatas: collectionViewCommon.getSelectedMetadatas(), userId: session.userId)
collectionViewCommon.tabBarSelect?.show()
// SEARCH (OFF)
collectionViewCommon.navigationItem.searchController = nil
let cancel = UIBarButtonItem(
image: UIImage(systemName: "xmark"),
style: .plain
) {
setCancelButton(for: collectionViewCommon.navigationItem) {
Task {
await collectionViewCommon.setEditMode(false)
}
}
cancel.accessibilityLabel = NSLocalizedString("_cancel_", comment: "")
let group = UIBarButtonItemGroup(
barButtonItems: [cancel],
representativeItem: nil
)
collectionViewCommon.navigationItem.trailingItemGroups = [group]
return
}
// TRASH EDIT MODE
if let trashViewController, trashViewController.isEditMode {
trashViewController.tabBarSelect.update(selectOcId: [])
trashViewController.tabBarSelect.show()
let cancel = UIBarButtonItem(
image: UIImage(systemName: "xmark"),
style: .plain
) {
setCancelButton(for: trashViewController.navigationItem) {
trashViewController.setEditMode(false)
}
cancel.accessibilityLabel = NSLocalizedString("_cancel_", comment: "")
let group = UIBarButtonItemGroup(
barButtonItems: [cancel],
representativeItem: nil
)
trashViewController.navigationItem.trailingItemGroups = [group]
return
}
@@ -248,18 +220,25 @@ class NCMainNavigationController: UINavigationController, UINavigationController
collectionViewCommon?.tabBarSelect?.hide()
// SEARCH (ON)
collectionViewCommon?.navigationItem.searchController = collectionViewCommon?.searchController
await collectionViewCommonTrailingItemGroups()
await updateNavigationMenu()
}
private func setCancelButton(for navigationItem: UINavigationItem, action: @escaping () -> Void) {
let cancel = UIBarButtonItem(image: UIImage(systemName: "xmark"), style: .plain) {
action()
}
cancel.accessibilityLabel = NSLocalizedString("_cancel_", comment: "")
navigationItem.additionalOverflowItems = nil
navigationItem.trailingItemGroups = [UIBarButtonItemGroup(barButtonItems: [cancel], representativeItem: nil)]
}
@MainActor
func collectionViewCommonTrailingItemGroups() async {
func updateNavigationMenu() async {
guard let topViewController else {
return
}
guard !(collectionViewCommon?.isEditMode ?? false),
!(trashViewController?.isEditMode ?? false),
!(mediaViewController?.isEditMode ?? false),
guard !isEditingContent,
!(topViewController is NCViewerPDF),
!(topViewController is NCViewerRichdocuments),
!(topViewController is NCViewerDirectEditing)
@@ -267,69 +246,27 @@ class NCMainNavigationController: UINavigationController, UINavigationController
return
}
// Keep screen-specific options in the navigation bar.
var desiredItems: [UIBarButtonItem] = []
if let optionMenu = await createOptionMenu() {
setOptionMenu(optionMenu)
desiredItems.append(optionButtonItem)
}
// ---------------------------------------------------------
// Read current items from trailingItemGroups
// ---------------------------------------------------------
let currentItems: [UIBarButtonItem] = topViewController.navigationItem.trailingItemGroups.flatMap { $0.barButtonItems }
let currentTags = currentItems.map { $0.tag }
let desiredTags = desiredItems.map { $0.tag }
// If nothing changed → exit
guard currentTags != desiredTags else {
return
}
let group = UIBarButtonItemGroup(
barButtonItems: desiredItems,
representativeItem: nil
)
topViewController.navigationItem.trailingItemGroups = [group]
let menu = await createOptionMenu()
guard self.topViewController === topViewController, !isEditingContent else { return }
setOptionMenu(menu, for: topViewController.navigationItem)
topViewController.navigationItem.trailingItemGroups = []
}
func createOptionMenu() async -> UIMenu? { return nil }
func updateMenuOption() async {
guard let topViewController else {
return
}
let hasOptionButton = topViewController.navigationItem.trailingItemGroups
.flatMap { $0.barButtonItems }
.contains(where: { $0.tag == optionButtonTag })
guard hasOptionButton else {
return
}
setOptionMenu(await createOptionMenu())
// Force refresh of the bar button group if the menu instance changed.
let currentGroups = topViewController.navigationItem.trailingItemGroups
if !currentGroups.isEmpty {
topViewController.navigationItem.trailingItemGroups = currentGroups
}
guard let topViewController, topViewController.navigationItem.additionalOverflowItems != nil else { return }
let menu = await createOptionMenu()
guard self.topViewController === topViewController, topViewController.navigationItem.additionalOverflowItems != nil else { return }
setOptionMenu(menu, for: topViewController.navigationItem)
}
/// Configures the options button for both direct toolbar display and UIKit's
/// navigation-bar overflow menu.
///
/// The button keeps its regular menu when it is displayed in the bar. When
/// UIKit moves it into the system overflow, the inline representation avoids
/// presenting another ellipsis submenu inside that overflow menu.
func setOptionMenu(_ menu: UIMenu?) {
optionButtonItem.menu = menu
optionButtonItem.menuRepresentation = menu.map {
UIMenu(title: "", options: .displayInline, children: $0.children)
/// Shares UIKit's overflow button with navigation items that no longer fit in the bar.
func setOptionMenu(_ menu: UIMenu?, for navigationItem: UINavigationItem) {
navigationItem.additionalOverflowItems = menu.map { menu in
UIDeferredMenuElement.uncached { completion in
completion(menu.children)
}
}
}
@@ -341,28 +278,34 @@ class NCMainNavigationController: UINavigationController, UINavigationController
func configureSidebarButton() {
guard let navigationItem = topViewController?.navigationItem else { return }
let groupedItems = navigationItem.leadingItemGroups.flatMap { $0.barButtonItems }
var items = groupedItems.isEmpty ? navigationItem.leftBarButtonItems ?? [] : groupedItems
var items = leadingItems
items.removeAll { $0 === sidebarButtonItem }
// Rebuild loading from its state so repeated updates cannot duplicate or retain a stopped spinner.
let albums = topViewController as? AlbumsViewController
let loadingItem = collectionViewCommon?.serverDataActivityBarButtonItem ?? trashViewController?.serverDataActivityBarButtonItem ?? albums?.serverDataActivityBarButtonItem
let loadingIndicator = collectionViewCommon?.serverDataActivityIndicator ?? trashViewController?.serverDataActivityIndicator ?? albums?.serverDataActivityIndicator
items.removeAll { $0 === loadingItem }
let isFiles = topViewController is NCFiles
if isFiles || topViewController === viewControllers.first,
controller != nil,
!(collectionViewCommon?.isEditMode ?? false),
!(mediaViewController?.isEditMode ?? false),
!(trashViewController?.isEditMode ?? false) {
!isEditingContent {
items.insert(sidebarButtonItem, at: 0)
if isFiles {
navigationItem.leftItemsSupplementBackButton = true
}
}
guard !items.isEmpty else {
navigationItem.leadingItemGroups = []
return
if albums != nil {
navigationItem.leftItemsSupplementBackButton = true
}
if let loadingItem, loadingIndicator?.isAnimating == true {
items.append(loadingItem)
}
// Match Media: each item has its own group; only the sidebar is always available.
navigationItem.leadingItemGroups = items.map { item in
let group = UIBarButtonItemGroup(barButtonItems: [item], representativeItem: nil)
group.alwaysAvailable = item === sidebarButtonItem
return group
}
let representative = items.count > 1 ? UIBarButtonItem(image: UIImage(systemName: "ellipsis")) : nil
let group = UIBarButtonItemGroup(barButtonItems: items, representativeItem: representative)
group.alwaysAvailable = true
navigationItem.leadingItemGroups = [group]
}
/// Changes the tint color of a specific left bar button item identified by tag.
@@ -371,10 +314,7 @@ class NCMainNavigationController: UINavigationController, UINavigationController
/// - color: The UIColor to be applied.
@MainActor
func setLeftItemColor(tag: Int, to color: UIColor) {
guard let navigationItem = topViewController?.navigationItem else { return }
let groupedItems = navigationItem.leadingItemGroups.flatMap { $0.barButtonItems }
let items = groupedItems.isEmpty ? navigationItem.leftBarButtonItems ?? [] : groupedItems
guard let item = items.first(where: { $0.tag == tag }) else { return }
guard let item = leadingItems.first(where: { $0.tag == tag }) else { return }
applyTint(item, color: color)
}
@@ -384,11 +324,7 @@ class NCMainNavigationController: UINavigationController, UINavigationController
/// - Parameter color: The UIColor to be applied.
@MainActor
func setAllLeftItemsColor(_ color: UIColor) {
guard let navigationItem = topViewController?.navigationItem else { return }
let groupedItems = navigationItem.leadingItemGroups.flatMap { $0.barButtonItems }
let items = groupedItems.isEmpty ? navigationItem.leftBarButtonItems ?? [] : groupedItems
for item in items {
for item in leadingItems {
applyTint(item, color: color)
}
}
@@ -403,11 +339,9 @@ class NCMainNavigationController: UINavigationController, UINavigationController
@MainActor
private func applyTint(_ button: UIButton, color: UIColor) {
if var cfg = button.configuration {
// Se in futuro userai UIButton.Configuration, tieni il colore allineato qui
cfg.baseForegroundColor = color
button.configuration = cfg
} else {
// Config attuale (nessuna configuration): SF Symbols sono template, quindi basta tintColor
button.tintColor = color
button.setTitleColor(color, for: .normal)
}
@@ -422,11 +356,11 @@ class NCMainNavigationController: UINavigationController, UINavigationController
}
}
/// Updates the tint color of all preloaded and currently visible right bar buttons.
/// Updates the tint color of the system overflow and currently visible right bar buttons.
/// - Parameter color: The UIColor to be applied to all right bar button items.
@MainActor
func updateRightBarButtonsTint(to color: UIColor) {
applyTint(optionButtonItem, color: color)
navigationBar.tintColor = color
if let visibleItems = topViewController?.navigationItem.rightBarButtonItems {
for item in visibleItems {
+1 -8
View File
@@ -257,14 +257,7 @@ class NCMainTabBarController: UITabBarController {
extension NCMainTabBarController: UITabBarControllerDelegate {
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
// Only a user tap on Browse restores All files. Sidebar selection is programmatic
// and must keep displaying the destination the user chose there.
if tabBarController.selectedIndex == 0,
let filesNavigationController,
viewController !== filesNavigationController || filesNavigationController.personalFilesOnly || filesNavigationController.viewControllers.count > 1 {
openSidebarFiles(personalFilesOnly: false)
return
}
// Browse retains the sidebar destination, personal filter and folder stack when switching tabs.
if previousIndex == tabBarController.selectedIndex {
scrollToTop(viewController: viewController)
}
+9 -1
View File
@@ -486,7 +486,7 @@ struct NCSidebarView: View {
.padding(.horizontal, 5)
.frame(minWidth: 18, minHeight: 18)
.background(.red, in: Capsule())
.offset(x: 6, y: -6)
.offset(notificationBadgeOffset)
.allowsHitTesting(false)
.accessibilityHidden(true)
}
@@ -499,6 +499,14 @@ struct NCSidebarView: View {
.controlSize(.regular)
}
private var notificationBadgeOffset: CGSize {
if #available(iOS 26.0, *) {
return CGSize(width: 6, height: -6)
}
// The bordered header can sit at the safe-area edge; keep its badge within the measured row.
return .zero
}
/// A fixed icon column keeps every destination's title aligned.
private func sidebarItem(_ title: LocalizedStringKey, systemImage: String, isSelected: Bool, subtitle: String? = nil, action: @escaping () -> Void) -> some View {
sidebarItem(title, icon: Image(systemName: systemImage).font(.system(size: 20, weight: .regular)), isSelected: isSelected, subtitle: subtitle, action: action)
@@ -154,10 +154,10 @@ extension NCMedia: UICollectionViewDelegate {
let sender = collectionView.cellForItem(at: indexPath) ?? collectionView
return UIContextMenuConfiguration(identifier: identifier, previewProvider: {
return NCViewerProviderContextMenu(metadata: metadata, image: image, sceneIdentifier: self.sceneIdentifier)
return NCViewerProviderContextMenu(metadata: metadata, image: image, sceneIdentifier: self.sceneIdentifier, sourceView: self.view)
}, actionProvider: { _ in
let contextMenu = NCContextMenuMain(metadata: metadata.detachedCopy(), viewController: self, controller: self.controller, sender: sender)
return contextMenu.viewMenu()
return contextMenu.viewMenu(showViewInFolder: true)
})
}
+9 -11
View File
@@ -39,10 +39,7 @@ class NCMedia: UIViewController {
var lastScale: CGFloat = 1.0
var currentScale: CGFloat = 1.0
var maxColumns: Int {
let screenWidth = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
let column = Int(screenWidth / 55)
return column
max(1, Int(collectionView.bounds.width / 55))
}
var transitionColumns = false
var lastNumberOfColumns: Int = 0
@@ -88,13 +85,12 @@ class NCMedia: UIViewController {
}
internal lazy var buttonDateBarItem: UIBarButtonItem = {
let item = UIBarButtonItem(
image: UIImage(systemName: "calendar"),
style: .plain,
target: self,
action: #selector(presentMediaDatePicker)
)
item.accessibilityLabel = NSLocalizedString("_select_date_", comment: "")
let action = UIAction(title: NSLocalizedString("_select_date_", comment: ""), image: UIImage(systemName: "calendar")) { [weak self] _ in
self?.presentMediaDatePicker()
}
let item = UIBarButtonItem(image: UIImage(systemName: "calendar"), primaryAction: action)
item.menuRepresentation = action
item.accessibilityLabel = action.title
if #available(iOS 27.1, *) {
item.axisBehavior = .horizontalOnly
}
@@ -344,6 +340,8 @@ class NCMedia: UIViewController {
// MARK: - NotificationCenter
func networkRemoveAll() async {
searchMediaTask?.cancel()
searchMediaTask = nil
timerSearchNewMedia?.invalidate()
timerSearchNewMedia = nil
+88 -4
View File
@@ -198,8 +198,6 @@ extension NCMedia {
guard self.isViewActived,
!self.searchMediaInProgress,
!self.isPinchGestureActive,
!self.showOnlyImages,
!self.showOnlyVideos,
(!self.isEditMode || self.allowsSearchWhileSelecting) else {
return false
}
@@ -297,6 +295,13 @@ extension NCMedia {
return
}
// SEARCH NEW MEDIA WITH AN ACTIVE FILTER (VIDEOS OR IMAGES)
//
if (self.showOnlyImages || self.showOnlyVideos), distant || lastDateNew == .distantPast {
await searchEarlierFilteredMedia(mediaPath: tblAccount.mediaPath, account: account)
return
}
// SEARCH NEW MEDIA
//
if firstDateNew == .distantFuture || lastDateNew == .distantPast {
@@ -355,6 +360,79 @@ extension NCMedia {
} finish: { }
}
/// Fetches both media types so switching filters never leaves a hole in the local timeline.
private func searchEarlierFilteredMedia(mediaPath: String, account: String) async {
let onlyImages = self.showOnlyImages
let onlyVideos = self.showOnlyVideos
let visibleOldestDate = self.dataSource.compactMetadatas.last?.date
let predicate = NCMedia.getMediaPredicate(session: self.session, mediaPath: mediaPath, showOnlyImages: false, showOnlyVideos: false)
let cachedMedia = await self.database.getMediaCompactMetadatasAsync(predicate: predicate, sortedByKeyPath: "date", ascending: false)
var upperDate = cachedMedia.last?.date ?? .distantFuture
let pageSize = await MainActor.run {
max(self.collectionView.visibleCells.count * 3, 300)
}
var limit = pageSize
while !Task.isCancelled,
self.isViewActived,
self.session.account == account,
self.showOnlyImages == onlyImages,
self.showOnlyVideos == onlyVideos {
var receivedFiles: [NKFile] = []
await NCMediaNetwork().searchMediaPage(
path: mediaPath,
firstDate: upperDate,
lastDate: .distantPast,
account: account,
paginate: false,
limit: limit) { _ in
} update: { files in
receivedFiles.append(contentsOf: files)
} finish: { }
guard !Task.isCancelled,
self.isViewActived,
self.session.account == account,
self.showOnlyImages == onlyImages,
self.showOnlyVideos == onlyVideos,
let oldestDate = receivedFiles.last?.date else {
return
}
// Keep the boundary inclusive: several files can have the same timestamp.
await self.updateMediaMetadatas(
files: receivedFiles,
firstDate: upperDate as NSDate,
lastDate: oldestDate as NSDate,
mediaPath: mediaPath,
account: account,
verifyDeletions: false,
update: { })
await self.loadDataSource()
let foundMatchingMedia = receivedFiles.contains { file in
guard file.hasPreview, visibleOldestDate.map({ file.date < $0 }) ?? true else {
return false
}
if onlyVideos {
return file.classFile == NKTypeClassFile.video.rawValue
}
return file.classFile == NKTypeClassFile.image.rawValue || (file.classFile == NKTypeClassFile.video.rawValue && !file.livePhotoFile.isEmpty)
}
if foundMatchingMedia || receivedFiles.count < limit {
return
}
if oldestDate < upperDate {
upperDate = oldestDate
limit = pageSize
} else {
// Expand a full same-date page rather than skipping files at that timestamp.
limit += pageSize
}
}
}
/// Searches the server for new media within the given date range,
/// syncs the returned files with the local database, and refreshes the UI.
internal func searchNetworkNewMedia(firstDate: Date,
@@ -449,6 +527,7 @@ extension NCMedia {
lastDate: NSDate,
mediaPath: String,
account: String,
verifyDeletions: Bool = true,
update: @escaping () -> Void) async {
guard !Task.isCancelled,
self.session.account == account else {
@@ -458,8 +537,8 @@ extension NCMedia {
let mediaPredicate = NCMedia.getMediaPredicate(
session: self.session,
mediaPath: mediaPath,
showOnlyImages: self.showOnlyImages,
showOnlyVideos: self.showOnlyVideos)
showOnlyImages: false,
showOnlyVideos: false)
let predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [
NSPredicate(format: "date >= %@ AND date <= %@", lastDate, firstDate), mediaPredicate
])
@@ -490,6 +569,11 @@ extension NCMedia {
update()
}
// A partial history page cannot establish that an absent file was deleted.
guard verifyDeletions else {
return
}
for batchStart in stride(from: 0, to: deletedMetadatas.count, by: maximumConcurrentChecks) {
guard !Task.isCancelled,
self.session.account == account else {
@@ -33,7 +33,12 @@ final class NCMediaDatePickerViewController: UIHostingController<NCMediaDatePick
rootView: NCMediaDatePickerView(model: model)
)
view.backgroundColor = .clear
if #available(iOS 26.0, *) {
view.backgroundColor = .clear
} else {
// Older sheets need an opaque host background behind both the title and wheel.
view.backgroundColor = .systemBackground
}
}
required init?(coder: NSCoder) {
@@ -46,31 +46,16 @@ class NCMediaNavigationController: NCMainNavigationController {
if media.isEditMode {
media.tabBarSelect.show()
await collectionViewCommonTrailingItemGroups()
} else {
media.tabBarSelect.hide()
await mediaTrailingItemGroups()
await collectionViewCommonTrailingItemGroups()
}
let menu = await createOptionMenu()
guard topViewController === media else { return }
setOptionMenu(menu, for: media.navigationItem)
media.navigationItem.trailingItemGroups = []
configureSidebarButton()
}
private func mediaTrailingItemGroups() async {
var desiredItems: [UIBarButtonItem] = []
if let optionMenu = await self.createOptionMenu() {
setOptionMenu(optionMenu)
desiredItems.append(optionButtonItem)
}
let group = UIBarButtonItemGroup(
barButtonItems: desiredItems,
representativeItem: nil
)
topViewController?.navigationItem.trailingItemGroups = [group]
}
override func createOptionMenu() async -> UIMenu? {
guard let media = topViewController as? NCMedia else {
return nil
@@ -103,8 +88,9 @@ class NCMediaNavigationController: NCMainNavigationController {
media.showOnlyImages = true
media.showOnlyVideos = false
Task {
await media.loadDataSource()
await media.networkRemoveAll()
await media.loadDataSource()
media.searchNewMedia()
}
},
@@ -112,8 +98,9 @@ class NCMediaNavigationController: NCMainNavigationController {
media.showOnlyImages = false
media.showOnlyVideos = true
Task {
await media.loadDataSource()
await media.networkRemoveAll()
await media.loadDataSource()
media.searchNewMedia()
}
},
@@ -121,8 +108,9 @@ class NCMediaNavigationController: NCMainNavigationController {
media.showOnlyImages = false
media.showOnlyVideos = false
Task {
await media.loadDataSource()
await media.networkRemoveAll()
await media.loadDataSource()
media.searchNewMedia()
}
}
]
+28
View File
@@ -7,6 +7,34 @@ import NextcloudKit
/// A collection of default UI actions used throughout the app.
enum NCContextMenuActions {
@MainActor
static func viewInFolder(metadata: tableMetadata, controller: NCMainTabBarController, viewController: UIViewController?) -> UIAction {
UIAction(
title: NSLocalizedString("_view_in_folder_", comment: ""),
image: UIImage(systemName: "questionmark.folder")
) { _ in
Task {
if let files = await NCNetworking.shared.moveInFolder(serverUrl: metadata.serverUrl, sceneIdentifier: controller.sceneIdentifier) {
files.loadViewIfNeeded()
files.view.layoutIfNeeded()
files.collectionView.layoutIfNeeded()
if let mediaViewer = viewController as? NCMediaViewerHostingController {
mediaViewer.close()
} else if let mediaViewer = viewController as? NCVideoVLCViewController {
mediaViewer.closeImmediately()
} else if let mediaViewer = viewController as? NCVideoAVPlayerViewController {
mediaViewer.closeImmediately()
}
try? await Task.sleep(for: .seconds(0.6))
files.blinkItem(ocId: metadata.ocId)
}
}
}
}
static func inlineMenu(
children: [UIMenuElement],
preferredElementSize: UIMenu.ElementSize? = nil
+50 -53
View File
@@ -38,13 +38,13 @@ class NCContextMenuMain: NSObject {
self.sender = sender
}
func viewMenu() -> UIMenu {
func viewMenu(showViewInFolder: Bool = false) -> UIMenu {
guard let capabilities = NCNetworking.shared.capabilities[metadata.account] else {
return UIMenu()
}
let topMenuItems = buildTopMenuItems(metadata: metadata)
let mainActionsMenu = buildMainActionsMenu(metadata: metadata, capabilities: capabilities)
let mainActionsMenu = buildMainActionsMenu(metadata: metadata, capabilities: capabilities, showViewInFolder: showViewInFolder)
let clientIntegrationMenu = buildClientIntegrationMenuItems(capabilities: capabilities, metadata: metadata)
let deleteMenu = buildDeleteMenu(metadata: metadata)
@@ -54,9 +54,10 @@ class NCContextMenuMain: NSObject {
menuElements.append(topMenu)
}
[mainActionsMenu, clientIntegrationMenu, deleteMenu]
menuElements.append(contentsOf: mainActionsMenu)
menuElements.append(contentsOf: [clientIntegrationMenu, deleteMenu]
.compactMap { NCContextMenuActions.inlineMenu(children: $0) }
.forEach { menuElements.append($0) }
)
return UIMenu(title: "", children: menuElements)
}
@@ -94,23 +95,24 @@ class NCContextMenuMain: NSObject {
// MARK: Main Actions Menu
private func buildMainActionsMenu(metadata: tableMetadata, capabilities: NKCapabilities.Capabilities) -> [UIMenuElement] {
var menuElements: [UIMenuElement] = []
private func buildMainActionsMenu(metadata: tableMetadata, capabilities: NKCapabilities.Capabilities, showViewInFolder: Bool) -> [UIMenuElement] {
// Keep the same section order as the viewer menu.
var openingActions: [UIMenuElement] = []
var editingActions: [UIMenuElement] = []
var savingActions: [UIMenuElement] = []
var securityActions: [UIMenuElement] = []
if NCNetworking.shared.isOnline,
!metadata.directory,
!capabilities.filesLockVersion.isEmpty {
menuElements.append(
NCContextMenuActions.lockUnlock(isLocked: metadata.lock,
metadata: metadata,
controller: controller)
)
if showViewInFolder, let controller {
openingActions.append(NCContextMenuActions.viewInFolder(metadata: metadata, controller: controller, viewController: viewController))
}
if !metadata.isDirectoryE2EE,
metadata.classFile == NKTypeClassFile.document.rawValue,
NextcloudKit.shared.isNetworkReachable() {
var availableEditors = Set(NCDocumentEditorSupport.directEditingEditorIdentifiers(account: metadata.account, contentType: metadata.contentType, fileName: metadata.fileNameView).map { $0.lowercased() })
var availableEditors = Set(
NCDocumentEditorSupport.directEditingEditorIdentifiers(account: metadata.account, contentType: metadata.contentType, fileName: metadata.fileNameView)
.map { $0.lowercased() }
)
if metadata.isLegacyRichdocumentsEditorAvailable {
availableEditors.insert(global.editorCollabora)
}
@@ -132,60 +134,55 @@ class NCContextMenuMain: NSObject {
}
if officeActions.count == 1, let action = officeActions.first {
menuElements.append(action)
openingActions.append(action)
} else if !officeActions.isEmpty {
menuElements.append(UIMenu(title: NSLocalizedString("_open_in_office_", comment: ""), image: UIImage(systemName: "doc.richtext"), children: officeActions))
openingActions.append(UIMenu(title: NSLocalizedString("_open_in_office_", comment: ""), image: UIImage(systemName: "doc.richtext"), children: officeActions))
}
}
addE2EEActions(metadata: metadata, capabilities: capabilities, mainActionsMenu: &menuElements)
if NCNetworking.shared.isOnline,
metadata.canSetAsAvailableOffline {
menuElements.append(
NCContextMenuActions.setAvailableOffline(
metadatas: [metadata],
isAnyOffline: metadata.isOffline,
controller: controller
)
)
}
if NCNetworking.shared.isOnline,
let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
menuElements.append(NCContextMenuActions.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV, windowScene: windowScene))
}
if NCNetworking.shared.isOnline,
metadata.isSavebleAsImage {
menuElements.append(NCContextMenuActions.saveAsScan(metadata: metadata, sceneIdentifier: sceneIdentifier))
}
if metadata.isRenameable {
menuElements.append(NCContextMenuActions.rename(metadata: metadata, presenter: viewController, windowScene: windowScene))
editingActions.append(NCContextMenuActions.rename(metadata: metadata, presenter: viewController, windowScene: windowScene))
}
if metadata.isCopyableMovable {
menuElements.append(
NCContextMenuActions.moveOrCopy(
metadatas: [metadata],
account: metadata.account,
controller: controller
)
)
editingActions.append(NCContextMenuActions.moveOrCopy(metadatas: [metadata], account: metadata.account, controller: controller))
}
if NCNetworking.shared.isOnline,
metadata.isModifiableWithQuickLook {
menuElements.append(makeModifyWithQuickLookAction(metadata: metadata))
editingActions.append(makeModifyWithQuickLookAction(metadata: metadata))
}
if viewController is NCFiles,
metadata.directory {
menuElements.append(makeColorFolderAction(metadata: metadata))
editingActions.append(makeColorFolderAction(metadata: metadata))
}
return menuElements
if NCNetworking.shared.isOnline,
metadata.canSetAsAvailableOffline {
savingActions.append(NCContextMenuActions.setAvailableOffline(metadatas: [metadata], isAnyOffline: metadata.isOffline, controller: controller))
}
if NCNetworking.shared.isOnline,
let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
savingActions.append(NCContextMenuActions.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV, windowScene: windowScene))
}
if NCNetworking.shared.isOnline,
metadata.isSavebleAsImage {
savingActions.append(NCContextMenuActions.saveAsScan(metadata: metadata, sceneIdentifier: sceneIdentifier))
}
if NCNetworking.shared.isOnline,
!metadata.directory,
!capabilities.filesLockVersion.isEmpty {
securityActions.append(NCContextMenuActions.lockUnlock(isLocked: metadata.lock, metadata: metadata, controller: controller))
}
addE2EEActions(metadata: metadata, capabilities: capabilities, mainActionsMenu: &securityActions)
return [openingActions, editingActions, savingActions, securityActions]
.compactMap { NCContextMenuActions.inlineMenu(children: $0) }
}
// MARK: E2EE Actions
@@ -473,12 +470,12 @@ class NCContextMenuMain: NSObject {
var iconImage = UIImage(systemName: "exclamationmark.triangle.fill")
if let iconUrl = item.icon {
let displayScale = max(self.viewController.view.traitCollection.displayScale, 1)
let results = await NextcloudKit.shared.downloadContentAsync(serverUrl: metadata.urlBase + iconUrl, account: metadata.account)
if results.error == .success, let data = results.responseData?.data,
let image = try? await NCSVGRenderer().renderSVGToUIImage(
svgData: data,
size: CGSize(width: UIScreen.main.scale * 20,
height: UIScreen.main.scale * 20),
size: CGSize(width: displayScale * 20, height: displayScale * 20),
tintColor: NCBrandColor.shared.iconImageColor,
trimTransparentPixels: false) {
iconImage = image
+54 -58
View File
@@ -41,7 +41,10 @@ class NCContextMenuViewer: NSObject {
}
var topMenuItems: [UIMenuElement] = []
var menuElements: [UIMenuElement] = []
var openingActions: [UIMenuElement] = []
var editingActions: [UIMenuElement] = []
var savingActions: [UIMenuElement] = []
var deleteActions: [UIMenuElement] = []
let localFile = database.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
let isOffline = localFile?.offline == true
@@ -72,23 +75,17 @@ class NCContextMenuViewer: NSObject {
}
if !webView {
menuElements.append(makeViewInFolderAction(metadata: metadata, controller: controller, viewController: viewController))
openingActions.append(NCContextMenuActions.viewInFolder(metadata: metadata, controller: controller, viewController: viewController))
}
if !webView,
metadata.canSetAsAvailableOffline {
menuElements.append(NCContextMenuActions.setAvailableOffline(metadatas: [metadata], isAnyOffline: isOffline, controller: controller))
}
if !webView,
NCNetworking.shared.isOnline,
metadata.isSavebleAsImage {
menuElements.append(NCContextMenuActions.saveAsScan(metadata: metadata, sceneIdentifier: controller.sceneIdentifier))
metadata.isPDF {
openingActions.append(contentsOf: makePDFActions())
}
if !webView,
metadata.isRenameable {
menuElements.append(NCContextMenuActions.rename(
editingActions.append(NCContextMenuActions.rename(
metadata: metadata,
presenter: viewController ?? controller,
windowScene: windowScene
@@ -100,31 +97,35 @@ class NCContextMenuViewer: NSObject {
if !webView,
metadata.isCopyableMovable {
menuElements.append(NCContextMenuActions.moveOrCopy(metadatas: [metadata], account: metadata.account, controller: controller))
}
if !webView,
NCNetworking.shared.isOnline,
let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
menuElements.append(NCContextMenuActions.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV, windowScene: windowScene))
}
if !webView,
metadata.isPDF {
menuElements.append(contentsOf: makePDFActions())
editingActions.append(NCContextMenuActions.moveOrCopy(metadatas: [metadata], account: metadata.account, controller: controller))
}
if !webView,
metadata.isImage,
utilityFileSystem.fileSizeIfExists(metadata) {
menuElements.append(makeModifyPhoto())
editingActions.append(makeModifyPhoto())
}
if !webView,
metadata.canSetAsAvailableOffline {
savingActions.append(NCContextMenuActions.setAvailableOffline(metadatas: [metadata], isAnyOffline: isOffline, controller: controller))
}
if !webView,
NCNetworking.shared.isOnline,
let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
savingActions.append(NCContextMenuActions.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV, windowScene: windowScene))
}
if !webView,
NCNetworking.shared.isOnline,
metadata.isSavebleAsImage {
savingActions.append(NCContextMenuActions.saveAsScan(metadata: metadata, sceneIdentifier: controller.sceneIdentifier))
}
if !webView,
metadata.isDeletable {
menuElements.append(UIMenu(options: .displayInline, children: [
NCContextMenuActions.delete(metadatas: [metadata], controller: controller, presentViewController: viewController)
]))
deleteActions.append(NCContextMenuActions.delete(metadatas: [metadata], controller: controller, presentViewController: viewController))
}
var finalMenuElements: [UIMenuElement] = []
@@ -133,9 +134,9 @@ class NCContextMenuViewer: NSObject {
finalMenuElements.append(topMenu)
}
if let baseMenu = NCContextMenuActions.inlineMenu(children: menuElements) {
finalMenuElements.append(baseMenu)
}
finalMenuElements.append(contentsOf: [openingActions, editingActions, savingActions, deleteActions]
.compactMap { NCContextMenuActions.inlineMenu(children: $0) }
)
return UIMenu(title: "", children: finalMenuElements)
}
@@ -160,6 +161,29 @@ class NCContextMenuViewer: NSObject {
return item
}
/// A standalone adaptive action; use its real button as the popover anchor.
static func mediaActionsButton(
viewController: UIViewController,
metadataProvider: @escaping () -> tableMetadata?,
controllerProvider: @escaping () -> NCMainTabBarController?
) -> UIButton {
let button = UIButton(type: .system)
button.setImage(NCImageCache.shared.getImageButtonMore(), for: .normal)
button.accessibilityLabel = NSLocalizedString("_more_", comment: "")
button.showsMenuAsPrimaryAction = true
button.menu = UIMenu(children: [
UIDeferredMenuElement.uncached { [weak viewController, weak button] completion in
guard let viewController, let button, let metadata = metadataProvider() else {
completion([])
return
}
let contextMenu = NCContextMenuViewer(metadata: metadata, controller: controllerProvider(), viewController: viewController, webView: false, sender: button)
completion(contextMenu.mediaMenu().children)
}
])
return button
}
private func mediaMenu() -> UIMenu {
var children = viewMenu()?.children ?? []
if let videoPlayerMenu = makeVideoPlayerMenu() {
@@ -243,34 +267,6 @@ class NCContextMenuViewer: NSObject {
capabilities.fileSharingApiEnabled || capabilities.filesComments || !capabilities.activity.isEmpty
}
private func makeViewInFolderAction(metadata: tableMetadata, controller: NCMainTabBarController, viewController: UIViewController?) -> UIAction {
UIAction(
title: NSLocalizedString("_view_in_folder_", comment: ""),
image: UIImage(systemName: "questionmark.folder")
) { _ in
Task {
if let files = await NCNetworking.shared.moveInFolder(serverUrl: metadata.serverUrl,
sceneIdentifier: controller.sceneIdentifier) {
files.loadViewIfNeeded()
files.view.layoutIfNeeded()
files.collectionView.layoutIfNeeded()
if let mediaViewer = viewController as? NCMediaViewerHostingController {
mediaViewer.close()
} else if let mediaViewer = viewController as? NCVideoVLCViewController {
mediaViewer.closeImmediately()
} else if let mediaViewer = viewController as? NCVideoAVPlayerViewController {
mediaViewer.closeImmediately()
}
try? await Task.sleep(for: .seconds(0.6))
files.blinkItem(ocId: metadata.ocId)
}
}
}
}
private func makePDFActions() -> [UIAction] {
[
UIAction(
-5
View File
@@ -93,11 +93,6 @@ final class NCGlobal: Sendable {
// CHUNK
let chunkSize = 100000000
// NCViewerProviderContextMenu
//
let maxAutoDownload: UInt64 = 50000000 // 50MB
let maxAutoDownloadCellular: UInt64 = 10000000 // 10MB
// Layout
//
let layoutList = "typeLayoutList"
+26 -101
View File
@@ -92,20 +92,14 @@ class NCNetworkingE2EE: NSObject {
/// subsequent E2EE access will perform one new server validation.
static func beginNewServerKeyValidationCycle() async {
await serverKeyValidationGate.beginNewActiveCycle()
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Started a new server-key validation cycle."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Started a new server-key validation cycle.")
}
/// Records a key set that was already fetched and cryptographically
/// verified by setup, avoiding a redundant request in the same cycle.
static func markServerKeyAsValidated(account: String) async {
await serverKeyValidationGate.markValidated(account: account)
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server key marked as validated by E2EE setup."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server key marked as validated by E2EE setup.")
}
/// Verifies once per active app cycle that the locally active user key is
@@ -118,35 +112,20 @@ class NCNetworkingE2EE: NSObject {
!localCertificate.isEmpty,
let serverPublicKey = preferences.getEndToEndPublicKey(account: account),
!serverPublicKey.isEmpty else {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server-key validation skipped because the active key set is incomplete."
)
return NKError(
errorCode: NCGlobal.shared.errorE2EENotEnabled,
errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: "")
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation skipped because the active key set is incomplete.")
return NKError(errorCode: NCGlobal.shared.errorE2EENotEnabled, errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: ""))
}
if preferences.isEndToEndServerKeyStale(account: account) {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server-key validation blocked because the active key set is stale."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation blocked because the active key set is stale.")
return Self.serverKeyChangedError
}
return await Self.serverKeyValidationGate.validate(
account: account
) {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Validating the active user key against the server."
)
return await Self.performServerKeyValidation(
account: account,
localCertificate: localCertificate,
serverPublicKey: serverPublicKey
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Validating the active user key against the server.")
return await Self.performServerKeyValidation(account: account, localCertificate: localCertificate, serverPublicKey: serverPublicKey
)
}
}
@@ -165,22 +144,13 @@ class NCNetworkingE2EE: NSObject {
)
if result.error.errorCode == NCGlobal.shared.errorResourceNotFound {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "The server user certificate is missing."
)
return markCurrentServerKeyAsStale(
account: account,
expectedCertificate: localCertificate,
preferences: preferences
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "The server user certificate is missing.")
return markCurrentServerKeyAsStale(account: account, expectedCertificate: localCertificate, preferences: preferences
)
}
guard result.error == .success else {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server-key validation request failed with error code \(result.error.errorCode)."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation request failed with error code \(result.error.errorCode).")
return result.error
}
@@ -188,18 +158,12 @@ class NCNetworkingE2EE: NSObject {
let endToEndEncryption = NCEndToEndEncryption.shared(),
let localUserPublicKey = endToEndEncryption.extractPublicKey(fromCertificate: localCertificate),
let remoteUserPublicKey = endToEndEncryption.extractPublicKey(fromCertificate: remoteCertificate) else {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server-key validation received invalid certificate data."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation received invalid certificate data.")
return .invalidData
}
guard endToEndEncryption.verifyCertificate(remoteCertificate, publicKey: serverPublicKey) else {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server-key validation detected an invalid remote certificate."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation detected an invalid remote certificate.")
return markCurrentServerKeyAsStale(
account: account,
expectedCertificate: localCertificate,
@@ -208,22 +172,12 @@ class NCNetworkingE2EE: NSObject {
}
guard networkingE2EE.publicKeysMatch(localUserPublicKey, remoteUserPublicKey) else {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Server-key validation detected a changed user key."
)
return markCurrentServerKeyAsStale(
account: account,
expectedCertificate: localCertificate,
preferences: preferences
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation detected a changed user key.")
return markCurrentServerKeyAsStale(account: account, expectedCertificate: localCertificate, preferences: preferences)
}
preferences.setEndToEndServerKeyStale(account: account, stale: false)
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "The active user key matches the server."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "The active user key matches the server.")
return .success
}
@@ -250,38 +204,23 @@ class NCNetworkingE2EE: NSObject {
// Setup may have replaced the active set while this request was in
// flight. An obsolete response must never mark the new set as stale.
guard preferences.getEndToEndCertificate(account: account) == expectedCertificate else {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Ignored an obsolete server-key validation response."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Ignored an obsolete server-key validation response.")
return .success
}
do {
try preferences.archiveCurrentEndToEndKeySet(account: account)
preferences.setEndToEndServerKeyStale(account: account, stale: true)
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Archived the active key set and marked it as stale."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Archived the active key set and marked it as stale.")
return serverKeyChangedError
} catch {
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "Unable to archive the active key set after server-key validation."
)
return NKError(
errorCode: NCGlobal.shared.errorInternalError,
errorDescription: error.localizedDescription
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Unable to archive the active key set after server-key validation.")
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
}
}
private static var serverKeyChangedError: NKError {
NKError(
errorCode: NCGlobal.shared.errorE2EEServerKeyChanged,
errorDescription: NSLocalizedString("_e2ee_server_key_changed_", comment: "")
)
NKError(errorCode: NCGlobal.shared.errorE2EEServerKeyChanged, errorDescription: NSLocalizedString("_e2ee_server_key_changed_", comment: ""))
}
// MARK: -
@@ -376,8 +315,7 @@ class NCNetworkingE2EE: NSObject {
let session = NCSession.shared.getSession(account: account)
let capabilities = await NKCapabilities.shared.getCapabilities(for: account)
guard let directory = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) else {
return NKError(errorCode: NCGlobal.shared.errorUnexpectedResponseFromDB,
errorDescription: NSLocalizedString("_e2ee_no_dir_", comment: ""))
return NKError(errorCode: NCGlobal.shared.errorUnexpectedResponseFromDB, errorDescription: NSLocalizedString("_e2ee_no_dir_", comment: ""))
}
if let addUserId {
@@ -423,10 +361,7 @@ class NCNetworkingE2EE: NSObject {
)
} catch {
await unlock(account: session.account, serverUrl: serverUrl)
return NKError(
errorCode: NCGlobal.shared.errorInternalError,
errorDescription: error.localizedDescription
)
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
}
guard storedAccess.writeAccessError == .success else {
@@ -512,17 +447,11 @@ class NCNetworkingE2EE: NSObject {
session: session
)
} catch {
return NKError(
errorCode: NCGlobal.shared.errorInternalError,
errorDescription: error.localizedDescription
)
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
}
let writeAccessError = access.writeAccessError
nkLog(
tag: NCGlobal.shared.logTagE2EE,
message: "E2EE write access \(writeAccessError == .success ? "granted" : "denied") using the \(access.diagnosticDescription) key set."
)
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "E2EE write access \(writeAccessError == .success ? "granted" : "denied") using the \(access.diagnosticDescription) key set.")
return writeAccessError
}
@@ -576,10 +505,7 @@ class NCNetworkingE2EE: NSObject {
return storedAccess.writeAccessError
}
} catch {
return NKError(
errorCode: NCGlobal.shared.errorInternalError,
errorDescription: error.localizedDescription
)
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
}
}
return resultsGetE2EEMetadata.error
@@ -602,8 +528,7 @@ class NCNetworkingE2EE: NSObject {
var e2eToken: String?
var e2eCounter = "1"
guard let directory = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl)) else {
return (nil, nil, NKError(errorCode: NCGlobal.shared.errorUnexpectedResponseFromDB,
errorDescription: NSLocalizedString("_e2ee_no_dir_", comment: "")))
return (nil, nil, NKError(errorCode: NCGlobal.shared.errorUnexpectedResponseFromDB, errorDescription: NSLocalizedString("_e2ee_no_dir_", comment: "")))
}
let capabilities = await NKCapabilities.shared.getCapabilities(for: account)
+2 -2
View File
@@ -263,8 +263,8 @@ class NCAutoUpload: NSObject {
mediaPredicates.append(NSPredicate(format: "mediaType == %i", PHAssetMediaType.video.rawValue))
}
if let autoUploadSinceDate = tblAccount.autoUploadSinceDate {
datePredicates.append(NSPredicate(format: "creationDate >= %@", autoUploadSinceDate as NSDate))
if let datePredicate = tblAccount.autoUploadDatePredicate {
datePredicates.append(datePredicate)
}
fetchOptions.predicate = {
+14 -15
View File
@@ -576,24 +576,23 @@ extension NCNetworking {
urlBase: metadata.urlBase)
utilityFileSystem.removeFile(atPath: fileNamePath)
// Auto Upload
if metadata.sessionSelector == global.selectorUploadAutoUpload {
#if !EXTENSION
// Photo library state shared by both auto-upload paths.
do {
try await NCLocalDatabase.shared.recordPhotoLibraryAssetUpload(
account: metadata.account,
assetLocalIdentifier: metadata.assetLocalIdentifier,
classFile: metadata.classFile,
isLivePhoto: metadata.isLivePhoto,
creationDate: metadata.creationDate as Date
)
} catch {
// The server upload remains successful even if its local PhotoKit state cannot be recorded.
nkLog(error: "Unable to record uploaded photo library asset \(metadata.assetLocalIdentifier): \(error)")
}
// Track Photos assets for both manual and automatic uploads.
// The database ignores empty asset identifiers and waits for both Live Photo components.
do {
try await NCLocalDatabase.shared.recordPhotoLibraryAssetUpload(account: metadata.account,
assetLocalIdentifier: metadata.assetLocalIdentifier,
classFile: metadata.classFile,
isLivePhoto: metadata.isLivePhoto,
creationDate: metadata.creationDate as Date)
} catch {
// The server upload remains successful even if its local PhotoKit state cannot be recorded.
nkLog(error: "Unable to record uploaded photo library asset \(metadata.assetLocalIdentifier): \(error)")
}
#endif
// Auto Upload
if metadata.sessionSelector == global.selectorUploadAutoUpload {
// LEGACY AUTO-UPLOAD history (Realm), returned for persistence by uploadSuccess.
if !backgroundAutoUpload, let serverUrlBase = metadata.autoUploadServerUrlBase {
autoUpload = tableAutoUploadTransfer(account: metadata.account,
+3 -2
View File
@@ -575,9 +575,10 @@ extension SceneDelegate: NCPasscodeDelegate {
accountRequestVC.delegate = self
accountRequestVC.startTimer(nil)
let screenHeighMax = UIScreen.main.bounds.height - (UIScreen.main.bounds.height / 5)
let availableHeight = controller?.view.safeAreaLayoutGuide.layoutFrame.height ?? window?.safeAreaLayoutGuide.layoutFrame.height ?? 0
let maximumHeight = availableHeight * 0.8
let numberCell = tblAccounts.count
let height = min(CGFloat(numberCell * Int(accountRequestVC.heightCell) + 45), screenHeighMax)
let height = min(CGFloat(numberCell * Int(accountRequestVC.heightCell) + 45), maximumHeight)
let popup = NCPopupViewController(contentController: accountRequestVC, popupWidth: 300, popupHeight: height + 20)
popup.backgroundAlpha = 0.8
@@ -156,7 +156,7 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling {
}
}
/// Changes the selection without discarding progress before Start is pressed.
/// Selecting the whole library clears the previous date; uploaded resources remain in history.
@MainActor
func handleAutoUploadTimespan(_ timespan: AutoUploadTimespan) {
guard !isChangingAutoUpload, !autoUploadStart else { return }
+8 -8
View File
@@ -10,18 +10,18 @@ enum NCShareCommon {
static let itemTypeFile = "file"
static let itemTypeFolder = "folder"
static func createLinkAvatar(imageName: String, colorCircle: UIColor) -> UIImage? {
static func createLinkAvatar(imageName: String, colorCircle: UIColor, scale: CGFloat) -> UIImage? {
let size: CGFloat = 200
let bottomImage = UIImage(named: "circle_fill")!.image(color: colorCircle, size: size / 2)
let topImage = NCUtility().loadImage(named: imageName, colors: [NCBrandColor.shared.iconImageColor])
UIGraphicsBeginImageContextWithOptions(CGSize(width: size, height: size), false, UIScreen.main.scale)
bottomImage.draw(in: CGRect(origin: CGPoint.zero, size: CGSize(width: size, height: size)))
topImage.draw(in: CGRect(origin: CGPoint(x: size / 4, y: size / 4), size: CGSize(width: size / 2, height: size / 2)))
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
let format = UIGraphicsImageRendererFormat.default()
format.scale = max(scale, 1)
let renderer = UIGraphicsImageRenderer(size: CGSize(width: size, height: size), format: format)
return renderer.image { _ in
bottomImage.draw(in: CGRect(origin: .zero, size: CGSize(width: size, height: size)))
topImage.draw(in: CGRect(origin: CGPoint(x: size / 4, y: size / 4), size: CGSize(width: size / 2, height: size / 2)))
}
}
static func copyLink(link: String, viewController: UIViewController, sender: Any) {
@@ -647,6 +647,11 @@
"_add_external_subtitle_" = "Add external subtitle";
"_repeat_current_media_" = "Repeat current item";
"_play_next_media_automatically_" = "Play next item automatically";
"_previous_media_" = "Previous";
"_next_media_" = "Next";
"_restart_audio_" = "Restart audio";
"_play_" = "Play";
"_pause_" = "Pause";
"_image_load_failed_" = "Image load failed";
"_image_load_failed_" = "Image load failed";
"_gif_file_could_not_be_decoded_" = "GIF file could not be decoded";
@@ -871,3 +876,6 @@
"_autoupload_force_reupload_footer_" = "Previous upload records are ignored for photos and videos in the selected library or date range. New completed uploads are still recorded. This option stays enabled until you turn it off.";
"_auto_upload_active_" = "Automatic photo and video upload active";
"_seek_backward_10_" = "Go back 10 seconds";
"_seek_forward_10_" = "Go forward 10 seconds";
Loaded 100 of 200 files, more files were not shown because too many files have changed in this diff. Show more