-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gallery of images #277
Gallery of images #277
Conversation
super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil) | ||
|
||
query.addObserver(self, forKeyPath: "hasChangesAvailable", options: [.initial, .new], context: nil) | ||
query.addFilter(itemsFilter, withIdentifier: "items-filter") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see looking through the changes on GitHub, you're reusing the OCQuery
instance from the ClientQueryViewController
instead of creating a new OCQuery
, so that adding a filter to only show files would also alter what can be seen in the ClientQueryViewController
.
An alternative would be to perform that filtering in observeValue(forKeyPath:…)
in the completionHandler of the query.requestChangeSet
call.
Also, regarding working KVO: you may need to first merge in the latest changes from ios-app/master
to get the latest SDK version which should properly report changes via the hasChangesAvailable
property (IIRC all but the latest had cases where it did not).
9239b9d
to
e846be3
Compare
Thank you @pablocarmu for your implementation. Please can you check if the UIViewController has a missing background color? You can see this, if the picture is not downloaded and no network is available: |
if let item = item, item.localID == self?.lastTappedItemLocalID, let core = core { | ||
let itemViewController = DisplayHostViewController(for: item, with: core, root: query.rootItem!) | ||
self?.navigationController?.pushViewController(itemViewController, animated: true) | ||
if let item = item, item.localID == self.lastTappedItemLocalID, let core = core { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pablocarmu I would probably not mix if let
constructs and regular if
conditions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll split them into 2 if-else
|
||
private let reuseIdentifier = "Cell" | ||
|
||
class AlternativeCollectionCollectionViewController: UICollectionViewController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pablocarmu CollectionCollection
?
if let parent = parent, let itemName = item.name { | ||
parent.navigationItem.title = itemName | ||
func updateNavigationBarItems() { | ||
if let parent = parent, let item = item, let itemName = item.name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pablocarmu you don't use item but just itemName? Or am I overlooking it?
if let item = dataSource?.itemFor(viewController: self) { | ||
self.item = item | ||
} else { | ||
if let nonSupportedView = dataSource?.nonSupportedItemView() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pablocarmu better notSupported
?
ownCloud/Gallery/AlternativeCollectionCollectionViewController.swift
Outdated
Show resolved
Hide resolved
ownCloud/Gallery/AlternativeCollectionCollectionViewController.swift
Outdated
Show resolved
Hide resolved
ownCloud/Gallery/AlternativeCollectionCollectionViewController.swift
Outdated
Show resolved
Hide resolved
|
||
// MARK: - ViewController lifecycle | ||
override func viewDidLoad() { | ||
super.viewDidLoad() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong code indention for the last two lines
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also wrong indention
@@ -130,6 +132,10 @@ extension WebViewDisplayViewController: DisplayExtension { | |||
|
|||
extension WebViewDisplayViewController: UIGestureRecognizerDelegate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong indention
If I zoom in, then swipe to the next image, then swipe back to the previous one, the previous one is still zoomed in. Bug or feature? iOS Photos:
iOS Files:
|
I also think zoom should be reset. |
…riendly' - Renamed the galleryhost to be more clear
- Finish the implementation of the gallery using PageViewController. - Code cleanup.
I didn't make any profile because I've never noticed this smooth-problem, but I'll check it with instruments |
You can also check out https://developer.apple.com/videos/play/wwdc2018/219/ |
- Use downsample technique in background to save memory and CPU cycles. - Improve the performance of the gallery.
@mneuwert I've used the downsample technique of the talk and I think the performance improvement is great. |
@pablocarmu Sounds good! I checked the implementation, and there is one more thing actually. When you zoom in, you will see downsampled and potentially pixelated version of the image, although the source image with higher resolution is available. So may be zooming can be done in more sophisticated way using dynamic downsampling based on the current zoom level, may be combined with tiling techniques in order to avoid memory usage going high. But it is also a question to @michaelstingl if we shall spend that effort or if we treat it as a separate feature. |
Can be improved in a separate PR… (I hope “Open in” sends the original file, not the downsampled one) |
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Codecov Report
@@ Coverage Diff @@
## master #277 +/- ##
=========================================
Coverage ? 29.48%
=========================================
Files ? 229
Lines ? 15477
Branches ? 0
=========================================
Hits ? 4564
Misses ? 10913
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #277 +/- ##
==========================================
- Coverage 29.86% 29.52% -0.35%
==========================================
Files 228 229 +1
Lines 15284 15484 +200
==========================================
+ Hits 4564 4571 +7
- Misses 10720 10913 +193
Continue to review full report at Codecov.
|
(1) -> Fixed Also, an issue to improve the GIF preview will be opened. From my side it is OK |
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
BUGS & IMPROVEMENTS