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

[fix/enable-markup-iOS16] Enabling Markup Mode on iOS 16 #1152

Merged
merged 6 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ ownCloud admins and users.
Summary
-------

* Bugfix - Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141)
* Bugfix - Enabling Markup Mode on iOS 16, Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141)
* Bugfix - Video Metadata Image: [#5296](https://github.com/owncloud/enterprise/issues/5296)
* Change - New Dark Mode Themes: [#1146](https://github.com/owncloud/ios-app/issues/1146)

Details
-------

* Bugfix - Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141)
* Bugfix - Enabling Markup Mode on iOS 16, Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141)

Fixes a bug when a new theme was activated, this causes that the UITabBar and UIToolbar does not
updates colours.
Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar
items. Furthermore when a new theme was choosen, this causes that the UITabBar and UIToolbar
does not updates colours.

https://github.com/owncloud/ios-app/issues/1141

Expand Down
5 changes: 3 additions & 2 deletions changelog/unreleased/1141
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Bugfix: Updating Theme
Bugfix: Enabling Markup Mode on iOS 16, Updating Theme

Fixes a bug when a new theme was activated, this causes that the UITabBar and UIToolbar does not updates colours.
Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar items.
Furthermore when a new theme was choosen, this causes that the UITabBar and UIToolbar does not updates colours.

https://github.com/owncloud/ios-app/issues/1141
13 changes: 12 additions & 1 deletion ownCloud/Client/Actions/EditDocumentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,18 @@ class EditDocumentViewController: QLPreviewController, Themeable {

@objc func enableEditingMode() {
// Activate editing mode by performing the action on pencil icon. Unfortunately that's the only way to do it apparently
if #available(iOS 15.0, *) {
if #available(iOS 16.0, *) {
if self.navigationItem.rightBarButtonItems?.count ?? 0 > 3 {
guard let markupButton = self.navigationItem.rightBarButtonItems?[0] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
} else if self.toolbarItems?.count ?? 0 > 4 {
guard let markupButton = self.toolbarItems?[4] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
} else if self.toolbarItems?.count ?? 0 < 4 {
guard let markupButton = self.toolbarItems?[2] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
}
} else if #available(iOS 15.0, *) {
if self.navigationItem.rightBarButtonItems?.count ?? 0 > 2 {
guard let markupButton = self.navigationItem.rightBarButtonItems?[1] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
Expand Down