-
-
Notifications
You must be signed in to change notification settings - Fork 975
Add new section in settings for Nextcloud apps #2461
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
Merged
mpivchev
merged 14 commits into
develop
from
2460-add-other-nextcloud-apps-to-settings-as-suggestions
Jun 26, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b3f75f7
Add new section in settings
mpivchev dbf46a7
WIP
mpivchev 643dc44
WIP
mpivchev ce9347b
Add new cell/refactor
mpivchev f87cbf3
Add url scheme for switching account
mpivchev 530df0c
Add docs
mpivchev 8c18976
Change icon
mpivchev 480190e
Add colors
mpivchev eeb84c3
Add more padding
mpivchev 5965eda
Remove hardcoded urls
mpivchev 05850ff
Merge branch 'develop' of https://github.com/nextcloud/ios into 2460-…
mpivchev 045ae5a
Refactor
mpivchev 0e27b5d
Remove unused files
mpivchev 9f54ed4
Update lint
mpivchev 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 hidden or 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 hidden or 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 hidden or 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
15 changes: 15 additions & 0 deletions
15
iOSClient/Images.xcassets/more-apps-template.imageset/Contents.json
This file contains hidden or 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,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "more-apps.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "template-rendering-intent" : "template" | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
iOSClient/Images.xcassets/more-apps-template.imageset/more-apps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
iOSClient/Images.xcassets/notes-template.imageset/Contents.json
This file contains hidden or 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,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "notes.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "template-rendering-intent" : "template" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
iOSClient/Images.xcassets/talk-template.imageset/Contents.json
This file contains hidden or 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,15 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "talk.png", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| }, | ||
| "properties" : { | ||
| "template-rendering-intent" : "template" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,36 @@ | ||
| // | ||
| // BaseNCMoreCell.swift | ||
| // Nextcloud | ||
| // | ||
| // Created by Milen on 15.06.23. | ||
| // Copyright © 2023 Marino Faggiana. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| class BaseNCMoreCell: UITableViewCell { | ||
| let selectionColor: UIView = UIView() | ||
| let defaultCornerRadius: CGFloat = 10.0 | ||
|
|
||
| override var frame: CGRect { | ||
| get { | ||
| return super.frame | ||
| } | ||
| set (newFrame) { | ||
| var frame = newFrame | ||
| let newWidth = frame.width * 0.90 | ||
| let space = (frame.width - newWidth) / 2 | ||
| frame.size.width = newWidth | ||
| frame.origin.x += space | ||
| super.frame = frame | ||
| } | ||
| } | ||
|
|
||
| override func awakeFromNib() { | ||
| super.awakeFromNib() | ||
|
|
||
| selectedBackgroundView = selectionColor | ||
| backgroundColor = .secondarySystemGroupedBackground | ||
| layer.cornerRadius = defaultCornerRadius | ||
| } | ||
| } | ||
This file contains hidden or 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,18 @@ | ||
| // | ||
| // CCCellMore.swift | ||
| // Nextcloud | ||
| // | ||
| // Created by Milen on 14.06.23. | ||
| // Copyright © 2023 Marino Faggiana. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| class CCCellMore: BaseNCMoreCell { | ||
| @IBOutlet weak var labelText: UILabel! | ||
| @IBOutlet weak var imageIcon: UIImageView! | ||
| @IBOutlet weak var separator: UIView! | ||
| @IBOutlet weak var separatorHeigth: NSLayoutConstraint! | ||
|
|
||
| static let reuseIdentifier = "CCCellMore" | ||
| } |
This file contains hidden or 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,57 @@ | ||
| // | ||
| // NCMoreAppSuggestionsCell.swift | ||
| // Nextcloud | ||
| // | ||
| // Created by Milen on 14.06.23. | ||
| // Copyright © 2023 Marino Faggiana. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| class NCMoreAppSuggestionsCell: BaseNCMoreCell { | ||
| @IBOutlet weak var talkView: UIStackView! | ||
| @IBOutlet weak var notesView: UIStackView! | ||
| @IBOutlet weak var moreAppsView: UIStackView! | ||
|
|
||
| static let reuseIdentifier = "NCMoreAppSuggestionsCell" | ||
|
|
||
| static func fromNib() -> UINib { | ||
| return UINib(nibName: "NCMoreAppSuggestionsCell", bundle: nil) | ||
| } | ||
|
|
||
| override func awakeFromNib() { | ||
| super.awakeFromNib() | ||
| backgroundColor = .clear | ||
|
|
||
| talkView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(talkTapped))) | ||
| notesView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(notesTapped))) | ||
| moreAppsView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(moreAppsTapped))) | ||
| } | ||
|
|
||
| @objc func talkTapped() { | ||
| guard let url = URL(string: NCGlobal.shared.talkSchemeUrl) else { return } | ||
|
|
||
| if UIApplication.shared.canOpenURL(url) { | ||
| UIApplication.shared.open(url) | ||
| } else { | ||
| guard let url = URL(string: NCGlobal.shared.talkAppStoreUrl) else { return } | ||
| UIApplication.shared.open(url) | ||
| } | ||
| } | ||
|
|
||
| @objc func notesTapped() { | ||
| guard let url = URL(string: NCGlobal.shared.notesSchemeUrl) else { return } | ||
|
|
||
| if UIApplication.shared.canOpenURL(url) { | ||
| UIApplication.shared.open(url) | ||
| } else { | ||
| guard let url = URL(string: NCGlobal.shared.notesAppStoreUrl) else { return } | ||
| UIApplication.shared.open(url) | ||
| } | ||
| } | ||
|
|
||
| @objc func moreAppsTapped() { | ||
| guard let url = URL(string: NCGlobal.shared.moreAppsUrl) else { return } | ||
| UIApplication.shared.open(url) | ||
| } | ||
| } |
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.
This code was used for every cell, so I made a base class instead.