Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
F343A4BF2A1E734600DDA874 /* Optional+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extensions.swift */; };
F343A4C02A1E734600DDA874 /* Optional+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extensions.swift */; };
F343A4C12A1E734600DDA874 /* Optional+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extensions.swift */; };
F39298972A3B12CB00509762 /* BaseNCMoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39298962A3B12CB00509762 /* BaseNCMoreCell.swift */; };
F3BB464D2A39ADCC00461F6E /* NCMoreAppSuggestionsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3BB464C2A39ADCC00461F6E /* NCMoreAppSuggestionsCell.xib */; };
F3BB464F2A39EBE500461F6E /* NCMoreUserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3BB464E2A39EBE500461F6E /* NCMoreUserCell.swift */; };
F3BB46522A39EC4900461F6E /* NCMoreAppSuggestionsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3BB46512A39EC4900461F6E /* NCMoreAppSuggestionsCell.swift */; };
F3BB46542A3A1E9D00461F6E /* CCCellMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3BB46532A3A1E9D00461F6E /* CCCellMore.swift */; };
F700222C1EC479840080073F /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; };
F700222D1EC479840080073F /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; };
F700510122DF63AC003A3356 /* NCShare.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F700510022DF63AC003A3356 /* NCShare.storyboard */; };
Expand Down Expand Up @@ -747,6 +752,11 @@
D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = "<group>"; };
F343A4B22A1E01FF00DDA874 /* PHAsset+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PHAsset+Extension.swift"; sourceTree = "<group>"; };
F343A4BA2A1E734600DDA874 /* Optional+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Optional+Extensions.swift"; sourceTree = "<group>"; };
F39298962A3B12CB00509762 /* BaseNCMoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNCMoreCell.swift; sourceTree = "<group>"; };
F3BB464C2A39ADCC00461F6E /* NCMoreAppSuggestionsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCMoreAppSuggestionsCell.xib; sourceTree = "<group>"; };
F3BB464E2A39EBE500461F6E /* NCMoreUserCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMoreUserCell.swift; sourceTree = "<group>"; };
F3BB46512A39EC4900461F6E /* NCMoreAppSuggestionsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMoreAppSuggestionsCell.swift; sourceTree = "<group>"; };
F3BB46532A3A1E9D00461F6E /* CCCellMore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCCellMore.swift; sourceTree = "<group>"; };
F700222B1EC479840080073F /* Custom.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Custom.xcassets; sourceTree = "<group>"; };
F700510022DF63AC003A3356 /* NCShare.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCShare.storyboard; sourceTree = "<group>"; };
F700510222DF6897003A3356 /* Parchment.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Parchment.framework; path = Carthage/Build/iOS/Parchment.framework; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1422,6 +1432,19 @@
path = Advanced;
sourceTree = "<group>";
};
F3BB46502A39EC2D00461F6E /* Cells */ = {
isa = PBXGroup;
children = (
F3BB464C2A39ADCC00461F6E /* NCMoreAppSuggestionsCell.xib */,
F3BB46512A39EC4900461F6E /* NCMoreAppSuggestionsCell.swift */,
F7EFC0C5256BC77700461AAD /* NCMoreUserCell.xib */,
F3BB464E2A39EBE500461F6E /* NCMoreUserCell.swift */,
F3BB46532A3A1E9D00461F6E /* CCCellMore.swift */,
F39298962A3B12CB00509762 /* BaseNCMoreCell.swift */,
);
path = Cells;
sourceTree = "<group>";
};
F70211F31BAC56E9003FC03E /* Main */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2104,7 +2127,7 @@
F7CB68942541670D0050EC94 /* More */ = {
isa = PBXGroup;
children = (
F7EFC0C5256BC77700461AAD /* NCMoreUserCell.xib */,
F3BB46502A39EC2D00461F6E /* Cells */,
F7CB68992541676B0050EC94 /* NCMore.storyboard */,
F73F537E1E929C8500F8678D /* NCMore.swift */,
);
Expand Down Expand Up @@ -2813,6 +2836,7 @@
F7362A1F220C853A005101B5 /* LaunchScreen.storyboard in Resources */,
F77444F622281649000D5EB0 /* NCGridMediaCell.xib in Resources */,
F78ACD4421903CF20088454D /* NCListCell.xib in Resources */,
F3BB464D2A39ADCC00461F6E /* NCMoreAppSuggestionsCell.xib in Resources */,
F7F4F10727ECDBDB008676F9 /* Inconsolata-Black.ttf in Resources */,
F761856D29E98543006EB3B0 /* NCIntroCollectionViewCell.xib in Resources */,
F78ACD4621903D010088454D /* NCGridCell.xib in Resources */,
Expand Down Expand Up @@ -3258,6 +3282,7 @@
F7B8CD91261AF3F7007C1359 /* NCNetworkingChunkedUpload.swift in Sources */,
F757CC8D29E82D0500F31428 /* NCGroupfolders.swift in Sources */,
F760329F252F0F8E0015A421 /* NCTransferCell.swift in Sources */,
F3BB46542A3A1E9D00461F6E /* CCCellMore.swift in Sources */,
AF68326A27BE65A90010BF0B /* NCMenuAction.swift in Sources */,
F7682FE023C36B0500983A04 /* NCMainTabBar.swift in Sources */,
F7A0D1352591FBC5008F8A13 /* String+Extension.swift in Sources */,
Expand All @@ -3267,6 +3292,7 @@
F70460522499061800BB98A7 /* NotificationCenter+MainThread.swift in Sources */,
F78F74362163781100C2ADAD /* NCTrash.swift in Sources */,
AF817EF1274BC781009ED85B /* NCUserBaseUrl.swift in Sources */,
F39298972A3B12CB00509762 /* BaseNCMoreCell.swift in Sources */,
AF2D7C7C2742556F00ADF566 /* NCShareLinkCell.swift in Sources */,
F7E41316294A19B300839300 /* UIView+Extension.swift in Sources */,
F7C30E00291BD2610017149B /* NCNetworkingE2EERename.swift in Sources */,
Expand Down Expand Up @@ -3323,6 +3349,7 @@
F76D364628A4F8BF00214537 /* NCActivityIndicator.swift in Sources */,
F7020FCE2233D7F700B7297D /* NCCreateFormUploadVoiceNote.swift in Sources */,
F7134186259747BA00768D21 /* NCPushNotification.m in Sources */,
F3BB464F2A39EBE500461F6E /* NCMoreUserCell.swift in Sources */,
F726EEEC1FED1C820030B9C8 /* NCEndToEndInitialize.swift in Sources */,
F79A65C62191D95E00FF6DCC /* NCSelect.swift in Sources */,
F75D19E325EFE09000D74598 /* NCTrash+Menu.swift in Sources */,
Expand Down Expand Up @@ -3352,6 +3379,7 @@
F749B64A297B0CBB00087535 /* NCManageDatabase+Share.swift in Sources */,
F7C9555521F0C5470024296E /* NCActivity.swift in Sources */,
F7725A60251F33BB00D125E0 /* NCFiles.swift in Sources */,
F3BB46522A39EC4900461F6E /* NCMoreAppSuggestionsCell.swift in Sources */,
F704B5E52430AA8000632F5F /* NCCreateFormUploadConflict.swift in Sources */,
F765608F23BF813600765969 /* NCContentPresenter.swift in Sources */,
F343A4BB2A1E734600DDA874 /* Optional+Extensions.swift in Sources */,
Expand Down
18 changes: 18 additions & 0 deletions iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}
}
return true

/*
Example:
nextcloud://open-and-switch-account?user=marinofaggiana&url=https://cloud.nextcloud.com
*/

} else if !account.isEmpty && scheme == NCGlobal.shared.appScheme && action == "open-and-switch-account" {
guard let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) else { return false }
let queryItems = urlComponents.queryItems

guard let userScheme = CCUtility.value(forKey: "user", fromQueryItems: queryItems) else { return false }
guard let urlScheme = CCUtility.value(forKey: "url", fromQueryItems: queryItems) else { return false }

if getMatchedAccount(userId: userScheme, url: urlScheme) == nil {
return false
}

return true
} else {
let applicationHandle = NCApplicationHandle()
let isHandled = applicationHandle.applicationOpenURL(url)
Expand Down
16 changes: 16 additions & 0 deletions iOSClient/Images.xcassets/more-template.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "more.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions iOSClient/Images.xcassets/notes-template.imageset/Contents.json
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 iOSClient/Images.xcassets/talk-template.imageset/Contents.json
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.
36 changes: 36 additions & 0 deletions iOSClient/More/Cells/BaseNCMoreCell.swift
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
}
Comment on lines +11 to +35
Copy link
Collaborator Author

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.

}
18 changes: 18 additions & 0 deletions iOSClient/More/Cells/CCCellMore.swift
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"
}
53 changes: 53 additions & 0 deletions iOSClient/More/Cells/NCMoreAppSuggestionsCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// 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()

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() {
let url = URL(string: "nextcloudtalk://")!

if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
} else {
UIApplication.shared.open(URL(string: "https://apps.apple.com/de/app/nextcloud-talk/id1296825574")!)
}
}

@objc func notesTapped() {
let url = URL(string: "nextcloudnotes://")!

if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
} else {
UIApplication.shared.open(URL(string: "https://apps.apple.com/de/app/nextcloud-notes/id813973264")!)
}
}

@objc func moreAppsTapped() {
UIApplication.shared.open(URL(string: "https://www.apple.com/us/search/nextcloud?src=globalnav")!)
}
}
Loading