|
@@ -44,12 +44,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
|
|
|
|
|
|
private var emptyDataSet: NCEmptyDataSet?
|
|
private var emptyDataSet: NCEmptyDataSet?
|
|
private let keyLayout = NCGlobal.shared.layoutViewShareExtension
|
|
private let keyLayout = NCGlobal.shared.layoutViewShareExtension
|
|
- private var serverUrlPush = ""
|
|
|
|
- private var metadataTouch: tableMetadata?
|
|
|
|
private var metadataFolder = tableMetadata()
|
|
private var metadataFolder = tableMetadata()
|
|
-
|
|
|
|
private var networkInProgress = false
|
|
private var networkInProgress = false
|
|
-
|
|
|
|
private var dataSource = NCDataSource()
|
|
private var dataSource = NCDataSource()
|
|
|
|
|
|
private var sort: String = ""
|
|
private var sort: String = ""
|
|
@@ -63,12 +59,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
|
|
private var autoUploadFileName = ""
|
|
private var autoUploadFileName = ""
|
|
private var autoUploadDirectory = ""
|
|
private var autoUploadDirectory = ""
|
|
|
|
|
|
- private var listLayout: NCListLayout!
|
|
|
|
-
|
|
|
|
private var shares: [tableShare]?
|
|
private var shares: [tableShare]?
|
|
-
|
|
|
|
private let refreshControl = UIRefreshControl()
|
|
private let refreshControl = UIRefreshControl()
|
|
-
|
|
|
|
private var activeAccount: tableAccount!
|
|
private var activeAccount: tableAccount!
|
|
|
|
|
|
override func viewDidLoad() {
|
|
override func viewDidLoad() {
|
|
@@ -78,10 +70,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
|
|
|
|
|
|
// Cell
|
|
// Cell
|
|
collectionView.register(UINib.init(nibName: "NCListCell", bundle: nil), forCellWithReuseIdentifier: "listCell")
|
|
collectionView.register(UINib.init(nibName: "NCListCell", bundle: nil), forCellWithReuseIdentifier: "listCell")
|
|
- collectionView.register(UINib.init(nibName: "NCGridCell", bundle: nil), forCellWithReuseIdentifier: "gridCell")
|
|
|
|
-
|
|
|
|
- listLayout = NCListLayout()
|
|
|
|
-
|
|
|
|
|
|
+ collectionView.collectionViewLayout = NCListLayout()
|
|
|
|
+
|
|
// Add Refresh Control
|
|
// Add Refresh Control
|
|
collectionView.addSubview(refreshControl)
|
|
collectionView.addSubview(refreshControl)
|
|
refreshControl.tintColor = NCBrandColor.shared.brandText
|
|
refreshControl.tintColor = NCBrandColor.shared.brandText
|
|
@@ -129,9 +119,7 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
|
|
autoUploadDirectory = NCManageDatabase.shared.getAccountAutoUploadDirectory(urlBase: activeAccount.urlBase, account: activeAccount.account)
|
|
autoUploadDirectory = NCManageDatabase.shared.getAccountAutoUploadDirectory(urlBase: activeAccount.urlBase, account: activeAccount.account)
|
|
|
|
|
|
(layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout,serverUrl: serverUrl)
|
|
(layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout,serverUrl: serverUrl)
|
|
-
|
|
|
|
- collectionView.collectionViewLayout = listLayout
|
|
|
|
-
|
|
|
|
|
|
+
|
|
// Load data source
|
|
// Load data source
|
|
serverUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account)
|
|
serverUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account)
|
|
// ROOT load files
|
|
// ROOT load files
|
|
@@ -150,6 +138,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
|
|
shares = NCManageDatabase.shared.getTableShares(account: activeAccount.account, serverUrl: serverUrl)
|
|
shares = NCManageDatabase.shared.getTableShares(account: activeAccount.account, serverUrl: serverUrl)
|
|
|
|
|
|
reloadDatasource(withLoadFolder: true)
|
|
reloadDatasource(withLoadFolder: true)
|
|
|
|
+
|
|
|
|
+ setNavigationBar()
|
|
}
|
|
}
|
|
|
|
|
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
|
@@ -526,8 +516,6 @@ extension NCShareExtension {
|
|
|
|
|
|
@objc func reloadDatasource(withLoadFolder: Bool) {
|
|
@objc func reloadDatasource(withLoadFolder: Bool) {
|
|
|
|
|
|
- setNavigationBar()
|
|
|
|
-
|
|
|
|
(layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout, serverUrl: serverUrl)
|
|
(layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout, serverUrl: serverUrl)
|
|
|
|
|
|
let metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND directory == true", activeAccount.account, serverUrl))
|
|
let metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND directory == true", activeAccount.account, serverUrl))
|