Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarinofaggiana <marino@marinofaggiana.com>2020-10-01 18:17:46 +0300
committermarinofaggiana <marino@marinofaggiana.com>2020-10-01 18:17:46 +0300
commitebabe90ea512895048c1b9483d57cb85162893f6 (patch)
tree15131b607344202490135c96dc91f373ae08656e /iOSClient
parent964b8df73b2749c899ad4e540e7fb64b145eb3a9 (diff)
coding
Diffstat (limited to 'iOSClient')
-rw-r--r--iOSClient/FileViewInFolder/NCFileViewInFolder.swift27
-rw-r--r--iOSClient/Main/NCCollectionCommon.swift1
-rw-r--r--iOSClient/Main/NCCollectionViewCommon.swift4
3 files changed, 30 insertions, 2 deletions
diff --git a/iOSClient/FileViewInFolder/NCFileViewInFolder.swift b/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
index 2c5d9376f..365a25372 100644
--- a/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
+++ b/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
@@ -27,6 +27,7 @@ import NCCommunication
class NCFileViewInFolder: NCCollectionViewCommon {
internal var isRoot: Bool = true
+ internal var fileName: String?
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
@@ -40,11 +41,37 @@ class NCFileViewInFolder: NCCollectionViewCommon {
DZNdescription = "_no_file_pull_down_"
}
+ override func viewWillAppear(_ animated: Bool) {
+ super.viewWillAppear(animated)
+
+ appDelegate.activeViewController = self
+
+ self.navigationItem.title = titleCurrentFolder
+
+ (layout, _, _, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: layoutKey, serverUrl: serverUrl)
+ gridLayout.itemForLine = CGFloat(itemForLine)
+
+ if layout == k_layout_list {
+ collectionView?.collectionViewLayout = listLayout
+ } else {
+ collectionView?.collectionViewLayout = gridLayout
+ }
+
+ self.navigationItem.rightBarButtonItem = nil
+ self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_close_", comment: ""), style: .plain, target: self, action: #selector(tapClose(sender:)))
+
+ reloadDataSource()
+ }
+
override func reloadDataSource(_ notification: NSNotification) {
if self.view?.window == nil { return }
reloadDataSource()
}
+ @objc func tapClose(sender: Any) {
+ dismiss(animated: true, completion: nil)
+ }
+
// MARK: - DataSource + NC Endpoint
override func reloadDataSource() {
diff --git a/iOSClient/Main/NCCollectionCommon.swift b/iOSClient/Main/NCCollectionCommon.swift
index f46bd55a9..335525746 100644
--- a/iOSClient/Main/NCCollectionCommon.swift
+++ b/iOSClient/Main/NCCollectionCommon.swift
@@ -131,6 +131,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
let navigationController = UINavigationController.init(rootViewController: viewController)
viewController.serverUrl = serverUrl
+ viewController.fileName = fileName
navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
diff --git a/iOSClient/Main/NCCollectionViewCommon.swift b/iOSClient/Main/NCCollectionViewCommon.swift
index 168a4459b..7d8273030 100644
--- a/iOSClient/Main/NCCollectionViewCommon.swift
+++ b/iOSClient/Main/NCCollectionViewCommon.swift
@@ -51,8 +51,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
private var autoUploadFileName = ""
private var autoUploadDirectory = ""
- private var listLayout: NCListLayout!
- private var gridLayout: NCGridLayout!
+ internal var listLayout: NCListLayout!
+ internal var gridLayout: NCGridLayout!
private let headerHeight: CGFloat = 50
private var headerRichWorkspaceHeight: CGFloat = 0