Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/filePreviewing
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-schwarz committed Oct 23, 2018
2 parents c118ef0 + 70552b0 commit 37a9365
Show file tree
Hide file tree
Showing 9 changed files with 303 additions and 22 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GEM
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.4)
fastlane (2.105.2)
fastlane (2.107.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
Expand Down Expand Up @@ -71,10 +71,10 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
googleauth (0.6.6)
googleauth (0.6.7)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.12)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.7)
Expand Down Expand Up @@ -105,7 +105,7 @@ GEM
rouge (2.0.7)
rubyzip (1.2.2)
security (0.1.3)
signet (0.10.0)
signet (0.11.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
Expand All @@ -127,7 +127,7 @@ GEM
unf_ext (0.0.7.5)
unicode-display_width (1.4.0)
word_wrap (1.0.0)
xcodeproj (1.6.0)
xcodeproj (1.7.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion ios-sdk
Submodule ios-sdk updated 26 files
+14 −34 ownCloudSDK.xcodeproj/project.pbxproj
+4 −2 ownCloudSDK/Connection/OCConnection.h
+30 −2 ownCloudSDK/Connection/OCConnection.m
+4 −3 ownCloudSDK/Core/Actions/OCSyncAction.h
+0 −222 ownCloudSDK/Core/Actions/Upload/LocalCreation/OCSyncActionLocalImport.m
+0 −37 ownCloudSDK/Core/Actions/Upload/LocalModification/OCCore+CommandLocalModification.m
+0 −23 ownCloudSDK/Core/Actions/Upload/LocalModification/OCSyncActionLocalModification.h
+0 −23 ownCloudSDK/Core/Actions/Upload/LocalModification/OCSyncActionLocalModification.m
+2 −2 ownCloudSDK/Core/Actions/Upload/OCCore+CommandLocalImport.m
+135 −0 ownCloudSDK/Core/Actions/Upload/OCCore+CommandLocalModification.m
+9 −5 ownCloudSDK/Core/Actions/Upload/OCSyncActionUpload.h
+305 −0 ownCloudSDK/Core/Actions/Upload/OCSyncActionUpload.m
+6 −1 ownCloudSDK/Core/OCCore.h
+16 −1 ownCloudSDK/Core/OCCore.m
+1 −2 ownCloudSDK/Core/Sync/OCSyncRecord.h
+1 −2 ownCloudSDK/Core/Sync/OCSyncRecord.m
+ ownCloudSDK/Resources/en_GB.lproj/Localizable.strings
+ ownCloudSDK/Resources/eu.lproj/Localizable.strings
+ ownCloudSDK/Resources/pt_BR.lproj/Localizable.strings
+ ownCloudSDK/Resources/ru.lproj/Localizable.strings
+ ownCloudSDK/Resources/sq.lproj/Localizable.strings
+ ownCloudSDK/Resources/th_TH.lproj/Localizable.strings
+ ownCloudSDK/Resources/zh_CN.lproj/Localizable.strings
+48 −6 ownCloudSDKTests/CoreSyncTests.m
+ ownCloudSDKTests/rainbow-crystalized.png
+ ownCloudUI/Resources/en_GB.lproj/Localizable.strings
10 changes: 8 additions & 2 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
2308F94321467F6200CF0B91 /* ClientDirectoryPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2308F93C21467F6200CF0B91 /* ClientDirectoryPickerViewController.swift */; };
232B01F42126B0CE00366FA0 /* MoreViewHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232B01F32126B0CE00366FA0 /* MoreViewHeader.swift */; };
232B01F62126B10900366FA0 /* MoreStaticTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232B01F52126B10900366FA0 /* MoreStaticTableViewController.swift */; };
232F7CAD2097140300EE22E4 /* UploadsSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232F7CAC2097140300EE22E4 /* UploadsSettingsSection.swift */; };
Expand Down Expand Up @@ -291,6 +292,7 @@

/* Begin PBXFileReference section */
05D694726A3BC5C5FE8AECB9 /* Pods-ownCloudTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ownCloudTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ownCloudTests/Pods-ownCloudTests.debug.xcconfig"; sourceTree = "<group>"; };
2308F93C21467F6200CF0B91 /* ClientDirectoryPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClientDirectoryPickerViewController.swift; sourceTree = "<group>"; };
232B01F32126B0CE00366FA0 /* MoreViewHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreViewHeader.swift; sourceTree = "<group>"; };
232B01F52126B10900366FA0 /* MoreStaticTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreStaticTableViewController.swift; sourceTree = "<group>"; };
232F7CAC2097140300EE22E4 /* UploadsSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadsSettingsSection.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -538,6 +540,7 @@
236735A421217C2300E5834A /* Actions */ = {
isa = PBXGroup;
children = (
2308F93C21467F6200CF0B91 /* ClientDirectoryPickerViewController.swift */,
236735A521217C3500E5834A /* MoreViewController.swift */,
232B01F32126B0CE00366FA0 /* MoreViewHeader.swift */,
232B01F52126B10900366FA0 /* MoreStaticTableViewController.swift */,
Expand All @@ -551,6 +554,7 @@
children = (
230B84F020597F6E00C9F828 /* ownCloudUI.framework */,
6E216A632112F58700ED21BD /* NamingViewController.swift */,
2370BC87212D4EE200A7A0E5 /* ClientDirectoryPickerViewController.swift */,
);
name = "Recovered References";
sourceTree = "<group>";
Expand Down Expand Up @@ -1243,6 +1247,7 @@
593BAB97209F8A0500023634 /* AppLockManager.swift in Sources */,
DCFED972208095E200A2D984 /* ClientItemCell.swift in Sources */,
23E22BB720C6A5C40024D11E /* UIDevice+UIUserInterfaceIdiom.swift in Sources */,
2370BC88212D4EE200A7A0E5 /* ClientDirectoryPickerViewController.swift in Sources */,
23F6238120B587EF004FDE8B /* SortMethod.swift in Sources */,
23EC77582137F3DD0032D4E6 /* PDFViewerViewController.swift in Sources */,
239F1319205A693A0029F186 /* UIColor+Extension.swift in Sources */,
Expand All @@ -1264,6 +1269,7 @@
DCE974BC207EACA60069FC2B /* UIImage+Extension.swift in Sources */,
DC1B2707209CF0D3004715E1 /* IssuesDismissalAnimator.swift in Sources */,
23BEF1182076667F00DD2E6F /* IssuesViewController.swift in Sources */,
2308F94321467F6200CF0B91 /* ClientDirectoryPickerViewController.swift in Sources */,
DC85980620D85EE600A433C6 /* AsyncSequentialQueue.swift in Sources */,
232B01F42126B0CE00366FA0 /* MoreViewHeader.swift in Sources */,
DCF4F17F2051A0D000189B9A /* StaticTableViewRow.swift in Sources */,
Expand Down Expand Up @@ -1478,7 +1484,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 64;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_TEAM = 4AP2STM4H5;
FRAMEWORK_SEARCH_PATHS = "${TARGET_BUILD_DIR}";
GCC_WARN_UNUSED_LABEL = YES;
Expand All @@ -1505,7 +1511,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 64;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_TEAM = 4AP2STM4H5;
FRAMEWORK_SEARCH_PATHS = "${TARGET_BUILD_DIR}";
GCC_WARN_UNUSED_LABEL = YES;
Expand Down
109 changes: 109 additions & 0 deletions ownCloud/Client/Actions/ClientDirectoryPickerViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
//
// ClientDirectoryPickerViewController.swift
// ownCloud
//
// Created by Pablo Carrascal on 22/08/2018.
// Copyright © 2018 ownCloud GmbH. All rights reserved.
//

import UIKit
import ownCloudSDK

class ClientDirectoryPickerViewController: ClientQueryViewController {

private let SELECT_BUTTON_HEIGHT: CGFloat = 44.0

// MARK: - Query directory filter
private static let DIRECTORY_FILTER_IDENTIFIER: String = "directory-filter"
private static var directoryFilterHandler: OCQueryFilterHandler = { (_, _, item) -> Bool in
if let item = item {
if item.type == .collection {return true}
}
return false
}
private static var directoryFilter: OCQueryFilter {
return OCQueryFilter(handler: ClientDirectoryPickerViewController.directoryFilterHandler)
}

// MARK: - Instance Properties
private var selectButton: UIBarButtonItem!
private var selectButtonTitle: String
private var cancelBarButton: UIBarButtonItem!
private var completion: (OCItem) -> Void

// MARK: - Init & deinit
init(core inCore: OCCore, path: String, selectButtonTitle: String = "Move here".localized, completion: @escaping (OCItem) -> Void) {
self.selectButtonTitle = selectButtonTitle
self.completion = completion

super.init(core: inCore, query: OCQuery(forPath: path)!)

self.query?.addFilter(ClientDirectoryPickerViewController.directoryFilter, withIdentifier: ClientDirectoryPickerViewController.DIRECTORY_FILTER_IDENTIFIER)

Theme.shared.register(client: self)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

deinit {
Theme.shared.unregister(client: self)
}

// MARK: - ViewController lifecycle
override func viewDidLoad() {
super.viewDidLoad()

// Select button creation
selectButton = UIBarButtonItem(title: selectButtonTitle, style: .plain, target: self, action: #selector(selectButtonPressed))
selectButton.title = selectButtonTitle

// Cancel button creation
cancelBarButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelBarButtonPressed))
navigationItem.rightBarButtonItem = cancelBarButton
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)

if let navController = self.navigationController {
navController.isToolbarHidden = false
let flexibleSpaceBarButton = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
self.setToolbarItems([flexibleSpaceBarButton, selectButton, flexibleSpaceBarButton], animated: false)
}
}

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let items = items else {
return
}

let item = items[indexPath.row]

guard item.type == OCItemType.collection else {
return
}

self.navigationController?.pushViewController(ClientDirectoryPickerViewController(core: core!, path: item.path, completion: completion), animated: true)
}

override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
return nil
}

// MARK: - Actions
@objc private func cancelBarButtonPressed() {
self.dismiss(animated: true)
}

@objc private func selectButtonPressed() {
guard let query = query else {
return
}

self.dismiss(animated: true, completion: {
self.completion(query.rootItem)
})
}
}
Loading

0 comments on commit 37a9365

Please sign in to comment.