Skip to content
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

[feature/whats new screen] In-App changelog "What´s new screen" #572

Merged
merged 21 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bd25e79
first draft of what´s new screen
hosy Oct 9, 2019
a440ed0
Autoplay Media / Show album artwork in the media player view (#566)
mneuwert Dec 3, 2019
c51f628
[fix/open-in-on-ipad] Share sheet not visible on iPad (#570)
hosy Dec 4, 2019
696aba0
Changed implementation for ReleaseNotes controller
hosy Dec 6, 2019
0508fa2
- moved release notes to new folder
hosy Dec 8, 2019
67081ab
Added task to update In-App changelog
hosy Dec 8, 2019
4e7b627
No longer needed, because code was moved
hosy Dec 8, 2019
3babefa
No longer needed, decided for other solution
hosy Dec 8, 2019
f842fb7
Merge branch 'milestone/1.2' into feature/whats-new-screen
hosy Dec 8, 2019
b3965f7
Merge branch 'feature/whats-new-screen' of github.com:owncloud/ios-ap…
hosy Dec 8, 2019
8d29fa6
code review fixes
hosy Dec 9, 2019
4a32767
fixed typo
hosy Dec 9, 2019
11a0bc0
Keyboard commands are available below iOS 13
hosy Dec 10, 2019
3de4e73
- no longer showing release notes after app install
hosy Jan 9, 2020
db724f5
Merge branch 'milestone/1.3' into feature/whats-new-screen
hosy Jan 13, 2020
190aa08
set correct short app version
hosy Jan 20, 2020
eff4f92
new check, if app was previously installed, with a key already exists…
hosy Jan 20, 2020
18e8408
- removed unneeded code
hosy Jan 20, 2020
6ee498d
if clause is needed, otherwise next else statement would be always true
hosy Jan 20, 2020
6af51be
changed fallback check, because .isBetaBuild always exists
hosy Jan 21, 2020
295e146
added support for customize app name
hosy Jan 21, 2020
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
3 changes: 2 additions & 1 deletion .github/release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Release a new version
- [ ] [DEV] Update `APP_SHORT_VERSION` `[major].[minor].[patch]` in [ownCloud.xcodeproj/project.pbxproj](https://github.com/owncloud/ios-app/blob/master/ownCloud.xcodeproj/project.pbxproj)
- [ ] [TRFX] Update translations from transifex branch.
- [ ] [DIS] Update [changelog](https://github.com/owncloud/ios-app/blob/master/CHANGELOG.md)
- [ ] [DEV] Update In-App Release Notes (changelog) in ownCloud/Release Notes/ReleaseNotes.plist
- [ ] [QA] Design Test plan
- [ ] [QA] Regression Test plan
- [ ] [DOC] Update user manual with the new functionalities
Expand All @@ -21,7 +22,7 @@ Release a new version

If it is required to update the iOS-SDK version:

- [ ] [GIT] Create branch library `release/[major].[minor].[patch]`(freeze the code)
- [ ] [GIT] Create branch library `release/[major].[minor].[patch]`(freeze the code)
- [ ] [mail] inform #marketing about the new release.
- [ ] [DIS] Update README.md (version number, third party, supported versions of iOS, Xcode)
- [ ] [DIS] Update [changelog](https://github.com/owncloud/ios-sdk/blob/master/CHANGELOG.md)
Expand Down
21 changes: 21 additions & 0 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
394E1FFF233E43F5009D2897 /* LinksAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 394E1FFE233E43F5009D2897 /* LinksAction.swift */; };
394E200C233E477F009D2897 /* OpenItemUserActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 394E200B233E477F009D2897 /* OpenItemUserActivity.swift */; };
39607CBC2225D480007B386D /* UITableViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39607CBB2225D480007B386D /* UITableViewController+Extension.swift */; };
3968C881239C54AC00AC28AC /* ReleaseNotesHostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3968C879239C54AC00AC28AC /* ReleaseNotesHostViewController.swift */; };
3961281622F8730A0087BD3A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3961281522F8730A0087BD3A /* SceneDelegate.swift */; };
3968C882239C54AD00AC28AC /* ReleaseNotesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3968C87A239C54AC00AC28AC /* ReleaseNotesTableViewController.swift */; };
3968C883239C54AD00AC28AC /* ReleaseNotes.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3968C87B239C54AC00AC28AC /* ReleaseNotes.plist */; };
396BE4C32288A84C00B254A9 /* PendingSharesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396BE4C22288A84C00B254A9 /* PendingSharesTableViewController.swift */; };
396BE4CA2289500E00B254A9 /* RoundedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396BE4C92289500E00B254A9 /* RoundedLabel.swift */; };
396C82FB2319AFDD00938262 /* CollaborateAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396C82FA2319AFDD00938262 /* CollaborateAction.swift */; };
Expand Down Expand Up @@ -636,7 +639,10 @@
394E1FFE233E43F5009D2897 /* LinksAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinksAction.swift; sourceTree = "<group>"; };
394E200B233E477F009D2897 /* OpenItemUserActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenItemUserActivity.swift; sourceTree = "<group>"; };
39607CBB2225D480007B386D /* UITableViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableViewController+Extension.swift"; sourceTree = "<group>"; };
3968C879239C54AC00AC28AC /* ReleaseNotesHostViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReleaseNotesHostViewController.swift; sourceTree = "<group>"; };
3961281522F8730A0087BD3A /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
3968C87A239C54AC00AC28AC /* ReleaseNotesTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReleaseNotesTableViewController.swift; sourceTree = "<group>"; };
3968C87B239C54AC00AC28AC /* ReleaseNotes.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ReleaseNotes.plist; sourceTree = "<group>"; };
396BE4C22288A84C00B254A9 /* PendingSharesTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PendingSharesTableViewController.swift; sourceTree = "<group>"; };
396BE4C92289500E00B254A9 /* RoundedLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedLabel.swift; sourceTree = "<group>"; };
396C82FA2319AFDD00938262 /* CollaborateAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollaborateAction.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1072,6 +1078,7 @@
233BDE9E204FEFE500C06732 /* ownCloud */ = {
isa = PBXGroup;
children = (
3968C878239C54AC00AC28AC /* Release Notes */,
39DED4922369879100CCC62C /* ImportFilesController.swift */,
233BDE9F204FEFE500C06732 /* AppDelegate.swift */,
3961281522F8730A0087BD3A /* SceneDelegate.swift */,
Expand Down Expand Up @@ -1223,6 +1230,16 @@
path = Library;
sourceTree = "<group>";
};
3968C878239C54AC00AC28AC /* Release Notes */ = {
isa = PBXGroup;
children = (
3968C879239C54AC00AC28AC /* ReleaseNotesHostViewController.swift */,
3968C87A239C54AC00AC28AC /* ReleaseNotesTableViewController.swift */,
3968C87B239C54AC00AC28AC /* ReleaseNotes.plist */,
);
path = "Release Notes";
sourceTree = "<group>";
};
394E2005233E4765009D2897 /* Window */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2326,6 +2343,7 @@
DCE5E8A82080D781005F60CE /* folder-public.tvg in Resources */,
DCE5E8B12080D781005F60CE /* package-x-generic.tvg in Resources */,
DCE5E8AD2080D781005F60CE /* folder-starred.tvg in Resources */,
3968C883239C54AD00AC28AC /* ReleaseNotes.plist in Resources */,
DCE5E8A22080D781005F60CE /* folder-external.tvg in Resources */,
DC85572D20513B8C00189B9A /* ServerListTableViewController.xib in Resources */,
6E938522220322F30049D676 /* SplashImage.png in Resources */,
Expand Down Expand Up @@ -2605,6 +2623,7 @@
DC248C67213E7DB00067FE94 /* NSLayoutConstraint+Extension.swift in Sources */,
6E586CFC2199A72600F680C4 /* OpenInAction.swift in Sources */,
DC136582208223F000FC0F60 /* OCBookmark+Extension.swift in Sources */,
3968C882239C54AD00AC28AC /* ReleaseNotesTableViewController.swift in Sources */,
23D77FCD212BFBD100DE76F1 /* NamingViewController.swift in Sources */,
23FA23E620BFD3D8009A6D73 /* SortBar.swift in Sources */,
3971B48F221B23FE006FB441 /* ThemeableColoredView.swift in Sources */,
Expand All @@ -2616,6 +2635,8 @@
39CC8AE6228C12100020253B /* Array+Extension.swift in Sources */,
6E83C78420A33C180066EC23 /* LAContext+Extension.swift in Sources */,
593BAB46209AE1BC00023634 /* PasscodeViewController.swift in Sources */,
397328EF22D606AC006CFAA4 /* ImportFilesController.swift in Sources */,
3968C881239C54AC00AC28AC /* ReleaseNotesHostViewController.swift in Sources */,
DC6428D02081406800493A01 /* CollapsibleProgressBar.swift in Sources */,
DCB44D87218718BA00DAA4CC /* VendorServices.swift in Sources */,
39E98B3E22797D1B009911F1 /* PublicLinkTableViewController.swift in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion ownCloud/Client/Actions/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ class ActionContext: OCExtensionContext {
weak var core: OCCore?
weak var query: OCQuery?
var items: [OCItem]
weak var sender: AnyObject?

// MARK: - Init & Deinit.
init(viewController: UIViewController, core: OCCore, query: OCQuery? = nil, items: [OCItem], location: OCExtensionLocation, requirements: [String : Any]? = nil, preferences: [String : Any]? = nil) {
init(viewController: UIViewController, core: OCCore, query: OCQuery? = nil, items: [OCItem], location: OCExtensionLocation, sender: AnyObject? = nil, requirements: [String : Any]? = nil, preferences: [String : Any]? = nil) {
self.items = items

super.init()

self.viewController = viewController
self.sender = sender
self.core = core
self.location = location

Expand Down
33 changes: 30 additions & 3 deletions ownCloud/Client/Actions/Actions+Extensions/OpenInAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class OpenInAction: Action {
hostViewController?.present(alertController, animated: true)
} else {
guard let files = files, files.count > 0, let viewController = hostViewController else { return }

// UIDocumentInteractionController can only be used with a single file
if files.count == 1 {
if let fileURL = files.first?.url {
Expand All @@ -70,7 +69,24 @@ class OpenInAction: Action {
// Present UIDocumentInteractionController
self.interactionController = UIDocumentInteractionController(url: fileURL)
self.interactionController?.delegate = self
self.interactionController?.presentOptionsMenu(from: .zero, in: viewController.view, animated: true)

if let sender = self.context.sender as? UITabBarController {
var sourceRect = sender.view.frame
sourceRect.origin.y = viewController.view.frame.size.height
sourceRect.size.width = 0.0
sourceRect.size.height = 0.0

self.interactionController?.presentOptionsMenu(from: sourceRect, in: sender.view, animated: true)
} else if let barButtonItem = self.context.sender as? UIBarButtonItem {
self.interactionController?.presentOptionsMenu(from: barButtonItem, animated: true)
} else if let cell = self.context.sender as? UITableViewCell, let clientQueryViewController = viewController as? ClientQueryViewController {
if let indexPath = clientQueryViewController.tableView.indexPath(for: cell) {
let cellRect = clientQueryViewController.tableView.rectForRow(at: indexPath)
self.interactionController?.presentOptionsMenu(from: cellRect, in: clientQueryViewController.tableView, animated: true)
}
} else {
self.interactionController?.presentOptionsMenu(from: viewController.view.frame, in: viewController.view, animated: true)
}
}
} else {
// Handle multiple files with a fallback solution
Expand All @@ -80,7 +96,18 @@ class OpenInAction: Action {
let activityController = UIActivityViewController(activityItems: urls, applicationActivities: nil)

if UIDevice.current.isIpad() {
activityController.popoverPresentationController?.sourceView = viewController.view
if let sender = self.context.sender as? UITabBarController {
var sourceRect = sender.view.frame
sourceRect.origin.y = viewController.view.frame.size.height
sourceRect.size.width = 0.0
sourceRect.size.height = 0.0

activityController.popoverPresentationController?.sourceView = sender.view
activityController.popoverPresentationController?.sourceRect = sourceRect
} else {
activityController.popoverPresentationController?.sourceView = viewController.view
activityController.popoverPresentationController?.sourceRect = viewController.view.frame
}
}

viewController.present(activityController, animated: true, completion: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class ClientDirectoryPickerViewController: ClientQueryViewController {
// Actions for Create Folder
if let core = self.core, let rootItem = query.rootItem {
let actionsLocation = OCExtensionLocation(ofType: .action, identifier: .folderAction)
let actionContext = ActionContext(viewController: self, core: core, items: [rootItem], location: actionsLocation)
let actionContext = ActionContext(viewController: self, core: core, items: [rootItem], location: actionsLocation, sender: sender)

let actions = Action.sortedApplicableActions(for: actionContext).filter { (action) -> Bool in
if action.actionExtension.identifier == OCExtensionIdentifier("com.owncloud.action.createFolder") {
Expand Down
9 changes: 5 additions & 4 deletions ownCloud/Client/ClientQueryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ class ClientQueryViewController: QueryFileListTableViewController, UIDropInterac
}

override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
guard let core = self.core, let item : OCItem = itemAt(indexPath: indexPath) else {
guard let core = self.core, let item : OCItem = itemAt(indexPath: indexPath), let cell = tableView.cellForRow(at: indexPath) else {
return nil
}

let actionsLocation = OCExtensionLocation(ofType: .action, identifier: .tableRow)
let actionContext = ActionContext(viewController: self, core: core, items: [item], location: actionsLocation)
let actionContext = ActionContext(viewController: self, core: core, items: [item], location: actionsLocation, sender: cell)
let actions = Action.sortedApplicableActions(for: actionContext)
actions.forEach({
$0.progressHandler = makeActionProgressHandler()
Expand Down Expand Up @@ -453,6 +453,7 @@ class ClientQueryViewController: QueryFileListTableViewController, UIDropInterac
// Find associated action
if let action = self.actions?.first(where: {type(of:$0).identifier == sender.actionIdentifier}) {
// Configure progress handler
action.context.sender = self.tabBarController
action.progressHandler = makeActionProgressHandler()

action.completionHandler = { [weak self] (_, _) in
Expand Down Expand Up @@ -523,7 +524,7 @@ class ClientQueryViewController: QueryFileListTableViewController, UIDropInterac
// Actions for folderAction
if let core = self.core, let rootItem = query.rootItem {
let actionsLocation = OCExtensionLocation(ofType: .action, identifier: .folderAction)
let actionContext = ActionContext(viewController: self, core: core, items: [rootItem], location: actionsLocation)
let actionContext = ActionContext(viewController: self, core: core, items: [rootItem], location: actionsLocation, sender: sender)

let actions = Action.sortedApplicableActions(for: actionContext)

Expand Down Expand Up @@ -552,7 +553,7 @@ class ClientQueryViewController: QueryFileListTableViewController, UIDropInterac
}

let actionsLocation = OCExtensionLocation(ofType: .action, identifier: .moreFolder)
let actionContext = ActionContext(viewController: self, core: core, query: query, items: [rootItem], location: actionsLocation)
let actionContext = ActionContext(viewController: self, core: core, query: query, items: [rootItem], location: actionsLocation, sender: sender)

if let moreViewController = Action.cardViewController(for: rootItem, with: actionContext, progressHandler: makeActionProgressHandler()) {
self.present(asCard: moreViewController, animated: true)
Expand Down
22 changes: 17 additions & 5 deletions ownCloud/Client/Viewer/DisplayHostViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DisplayHostViewController: UIPageViewController {
}

// MARK: - Constants
let imageFilterRegexp: String = "\\A((image/*))" // Filters all the mime types that are images (incluiding gif and svg)
let mediaFilterRegexp: String = "\\A(((image|audio|video)/*))" // Filters all the mime types that are images (incluiding gif and svg)

// MARK: - Instance Variables
weak private var core: OCCore?
Expand Down Expand Up @@ -61,7 +61,7 @@ class DisplayHostViewController: UIPageViewController {

query.requestChangeSet(withFlags: .onlyResults) { ( _, changeSet) in
guard let changeSet = changeSet else { return }
if let queryResult = changeSet.queryResult, let newItems = self?.applyImageFilesFilter(items: queryResult) {
if let queryResult = changeSet.queryResult, let newItems = self?.applyMediaFilesFilter(items: queryResult) {
let shallUpdateDatasource = self?.items?.count != newItems.count ? true : false

self?.items = newItems
Expand Down Expand Up @@ -105,6 +105,8 @@ class DisplayHostViewController: UIPageViewController {
displayController.itemIndex = currentIndex
}
}

NotificationCenter.default.addObserver(self, selector: #selector(handleMediaPlaybackFinished(notification:)), name: MediaDisplayViewController.MediaPlaybackFinishedNotification, object: nil)
}

override var childForHomeIndicatorAutoHidden : UIViewController? {
Expand Down Expand Up @@ -247,9 +249,9 @@ class DisplayHostViewController: UIPageViewController {
}

// MARK: - Filters
private func applyImageFilesFilter(items: [OCItem]) -> [OCItem] {
if initialItem.mimeType?.matches(regExp: imageFilterRegexp) ?? false {
let filteredItems = items.filter({$0.type != .collection && $0.mimeType?.matches(regExp: self.imageFilterRegexp) ?? false})
private func applyMediaFilesFilter(items: [OCItem]) -> [OCItem] {
if initialItem.mimeType?.matches(regExp: mediaFilterRegexp) ?? false {
let filteredItems = items.filter({$0.type != .collection && $0.mimeType?.matches(regExp: self.mediaFilterRegexp) ?? false})
return filteredItems
} else {
let filteredItems = items.filter({$0.type != .collection && $0.fileID == self.initialItem.fileID})
Expand Down Expand Up @@ -323,3 +325,13 @@ extension DisplayHostViewController: Themeable {
self.view.backgroundColor = .black
}
}

extension DisplayHostViewController {
@objc private func handleMediaPlaybackFinished(notification:Notification) {
if let mediaController = self.viewControllers?.first as? MediaDisplayViewController {
if let vc = vendNewViewController(from: mediaController, .after) {
self.setViewControllers([vc], direction: .forward, animated: false, completion: nil)
}
}
}
}
4 changes: 2 additions & 2 deletions ownCloud/Client/Viewer/DisplayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ class DisplayViewController: UIViewController, OCQueryDelegate {
//self.showPreviewButton?.isHidden = false
}

@objc func optionsBarButtonPressed() {
@objc func optionsBarButtonPressed(_ sender: UIBarButtonItem) {
guard let core = core, let item = item else {
return
}

let actionsLocation = OCExtensionLocation(ofType: .action, identifier: .moreItem)
let actionContext = ActionContext(viewController: self, core: core, items: [item], location: actionsLocation)
let actionContext = ActionContext(viewController: self, core: core, items: [item], location: actionsLocation, sender: sender)

if let moreViewController = Action.cardViewController(for: item, with: actionContext, completionHandler: nil) {
self.present(asCard: moreViewController, animated: true)
Expand Down
Loading