-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: External links #1236
Closed
Closed
feat: External links #1236
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9b1f099
WIP endpoints
adrien-coye b91e02f
chore: Merge branch 'master' into externalLinks
adrien-coye 00271f3
feat: In memory realm for external share context
adrien-coye 729fd5e
fix: Project builds
adrien-coye 9c21f67
chore: Merge branch 'master' into externalLinks
adrien-coye 2d38281
feat: Public share metadata WIP
adrien-coye e821a54
feat(Rights): Updated to be compatible with public share
adrien-coye 254255e
feat(PublicShareMetadata): Parsing pass
adrien-coye 72fe9cf
chore: Merge branch 'master' into externalLinks
adrien-coye 30389e1
refactor(Endpoint): Split files into dedicated extensiions
adrien-coye 4db1410
chore: Merge branch 'master' into externalLinks
adrien-coye 4dfc177
feat: Fetch root folder for a public share
adrien-coye 638b423
feat: Cursored public share children query
adrien-coye fd7dfab
feat: Can natively show a public share within the app
adrien-coye fb9442b
chore: Merge branch 'master' into externalLinks
adrien-coye d9bc2d3
fix(FilePresenter): Present public share in context
adrien-coye 7c8c2c7
fix: Capabilities for Public Share
adrien-coye 70d65a0
feat: Thumbnails on public share
adrien-coye d352554
feat: Can navigate hierarchy of public share folders
adrien-coye 07e1c48
feat: Preview for public share
adrien-coye c26647f
feat: Download file from public share
adrien-coye 76bf4e0
feat: Actions match spec on public share
adrien-coye c6a78e7
chore: Merge branch 'master' into externalLinks
adrien-coye 14c2ca0
fix: Tuist config update to build
adrien-coye 7224695
feat: Add to my drive button
adrien-coye 98822b8
chore: Merge branch 'master' into externalLinks
adrien-coye a1bf2c4
WIP
adrien-coye 31e6119
chore: Matomo for public share tasks
adrien-coye a4b8d70
chore: Align Matomo with android on what exists
adrien-coye e7d49dc
feat: Download all files from current folder as a ZIP within a public…
adrien-coye 126df8e
chore: Merge branch 'master' into externalLinks
adrien-coye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 141 additions & 0 deletions
141
kDrive/UI/Controller/Create File/FloatingPanelLayouts.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* | ||
Infomaniak kDrive - iOS App | ||
Copyright (C) 2024 Infomaniak Network SA | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import FloatingPanel | ||
import kDriveCore | ||
import kDriveResources | ||
import UIKit | ||
|
||
/// Layout used for a folder within a public share | ||
class PublicShareFolderFloatingPanelLayout: FloatingPanelLayout { | ||
var position: FloatingPanelPosition = .bottom | ||
var initialState: FloatingPanelState = .tip | ||
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] | ||
private var backdropAlpha: CGFloat | ||
|
||
init(initialState: FloatingPanelState = .tip, hideTip: Bool = false, safeAreaInset: CGFloat = 0, backdropAlpha: CGFloat = 0) { | ||
self.initialState = initialState | ||
self.backdropAlpha = backdropAlpha | ||
let extendedAnchor = FloatingPanelLayoutAnchor( | ||
absoluteInset: 140.0 + safeAreaInset, | ||
edge: .bottom, | ||
referenceGuide: .superview | ||
) | ||
anchors = [ | ||
.full: extendedAnchor, | ||
.half: extendedAnchor, | ||
.tip: FloatingPanelLayoutAnchor(absoluteInset: 86.0 + safeAreaInset, edge: .bottom, referenceGuide: .superview) | ||
] | ||
} | ||
|
||
func backdropAlpha(for state: FloatingPanelState) -> CGFloat { | ||
return backdropAlpha | ||
} | ||
} | ||
|
||
/// Layout used for a file within a public share | ||
class PublicShareFileFloatingPanelLayout: FloatingPanelLayout { | ||
var position: FloatingPanelPosition = .bottom | ||
var initialState: FloatingPanelState = .tip | ||
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] | ||
private var backdropAlpha: CGFloat | ||
|
||
init(initialState: FloatingPanelState = .tip, hideTip: Bool = false, safeAreaInset: CGFloat = 0, backdropAlpha: CGFloat = 0) { | ||
self.initialState = initialState | ||
self.backdropAlpha = backdropAlpha | ||
let extendedAnchor = FloatingPanelLayoutAnchor( | ||
absoluteInset: 248.0 + safeAreaInset, | ||
edge: .bottom, | ||
referenceGuide: .superview | ||
) | ||
anchors = [ | ||
.full: extendedAnchor, | ||
.half: extendedAnchor, | ||
.tip: FloatingPanelLayoutAnchor(absoluteInset: 86.0 + safeAreaInset, edge: .bottom, referenceGuide: .superview) | ||
] | ||
} | ||
|
||
func backdropAlpha(for state: FloatingPanelState) -> CGFloat { | ||
return backdropAlpha | ||
} | ||
} | ||
|
||
class FileFloatingPanelLayout: FloatingPanelLayout { | ||
var position: FloatingPanelPosition = .bottom | ||
var initialState: FloatingPanelState = .tip | ||
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] | ||
private var backdropAlpha: CGFloat | ||
|
||
init(initialState: FloatingPanelState = .tip, hideTip: Bool = false, safeAreaInset: CGFloat = 0, backdropAlpha: CGFloat = 0) { | ||
self.initialState = initialState | ||
self.backdropAlpha = backdropAlpha | ||
if hideTip { | ||
anchors = [ | ||
.full: FloatingPanelLayoutAnchor(absoluteInset: 16.0, edge: .top, referenceGuide: .safeArea), | ||
.half: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .safeArea) | ||
] | ||
} else { | ||
anchors = [ | ||
.full: FloatingPanelLayoutAnchor(absoluteInset: 16.0, edge: .top, referenceGuide: .safeArea), | ||
.half: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .safeArea), | ||
.tip: FloatingPanelLayoutAnchor(absoluteInset: 86.0 + safeAreaInset, edge: .bottom, referenceGuide: .superview) | ||
] | ||
} | ||
} | ||
|
||
func backdropAlpha(for state: FloatingPanelState) -> CGFloat { | ||
return backdropAlpha | ||
} | ||
} | ||
|
||
class PlusButtonFloatingPanelLayout: FloatingPanelLayout { | ||
var position: FloatingPanelPosition = .bottom | ||
var height: CGFloat = 16 | ||
|
||
init(height: CGFloat) { | ||
self.height = height | ||
} | ||
|
||
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] { | ||
return [ | ||
.full: FloatingPanelLayoutAnchor(absoluteInset: height, edge: .bottom, referenceGuide: .safeArea) | ||
] | ||
} | ||
|
||
var initialState: FloatingPanelState = .full | ||
|
||
func backdropAlpha(for state: FloatingPanelState) -> CGFloat { | ||
return 0.2 | ||
} | ||
} | ||
|
||
class InformationViewFloatingPanelLayout: FloatingPanelLayout { | ||
var position: FloatingPanelPosition = .bottom | ||
|
||
var initialState: FloatingPanelState = .full | ||
|
||
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] { | ||
return [ | ||
.full: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 0, referenceGuide: .safeArea) | ||
] | ||
} | ||
|
||
func backdropAlpha(for state: FloatingPanelState) -> CGFloat { | ||
return 0.3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
TODO remove