Skip to content

Commit

Permalink
Merge branch 'feature/account-wizard' into feature/image-interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-schwarz committed Oct 23, 2023
2 parents 7404bbd + 9f49f70 commit 2607e37
Show file tree
Hide file tree
Showing 38 changed files with 754 additions and 200 deletions.
34 changes: 34 additions & 0 deletions doc/CONFIGURATION.json
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,19 @@
"status" : "advanced",
"type" : "dictionary"
},
{
"autoExpansion" : "none",
"category" : "Branding",
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"description" : "Color in hex notation that should be used as tint color instead of the standard system tint color that is used throughout the app for buttons and other controls. This color is only used if no themes are defined otherwise.",
"flatIdentifier" : "branding.theme-tint-color",
"key" : "theme-tint-color",
"label" : "Theme Tint Color",
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Branding",
Expand Down Expand Up @@ -1105,6 +1118,19 @@
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"description" : "Sets a custom version number for the app.",
"flatIdentifier" : "build.version-number",
"key" : "version-number",
"label" : "build.version-number",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Connection",
Expand Down Expand Up @@ -1839,6 +1865,14 @@
"description" : "Extension with the identifier simple-apm.",
"value" : "simple-apm"
},
{
"description" : "Extension with the identifier system.dark.",
"value" : "system.dark"
},
{
"description" : "Extension with the identifier system.light.",
"value" : "system.light"
},
{
"description" : "Extension with the identifier web-finger.",
"value" : "web-finger"
Expand Down
20 changes: 20 additions & 0 deletions doc/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,14 @@ branding.sidebar-links-title
|Dictionary defining generic colors that can be used in the definitions.
|advanced `candidate`

|**Theme Tint Color** +
+
branding.theme-tint-color
|string
|
|Color in hex notation that should be used as tint color instead of the standard system tint color that is used throughout the app for buttons and other controls. This color is only used if no themes are defined otherwise.
|advanced `candidate`

|**Documentation URL** +
+
branding.url-documentation
Expand Down Expand Up @@ -668,6 +676,12 @@ tag::build[]
|Set a custom app group identifier via Branding.plist parameter. This value will be set by fastlane. Changes OCAppGroupIdentifier, OCKeychainAccessGroupIdentifier only. Fastlane does not need the provisioning profile and certificate with the given app group identifer. Needs resigning with the correct provisioning profile and certificate. This is needed, if a customer is using an own resigning script which does not handle setting the app group identifier.
|supported `candidate`

|build.version-number
|string
|
|Sets a custom version number for the app.
|supported `candidate`

|===
end::build[]

Expand Down Expand Up @@ -1137,6 +1151,12 @@ tag::extensions[]
! `simple-apm`
! Extension with the identifier simple-apm.

! `system.dark`
! Extension with the identifier system.dark.

! `system.light`
! Extension with the identifier system.light.

! `web-finger`
! Extension with the identifier web-finger.

Expand Down
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ end
# Check, if Branding.plist file exists and handle custom set values
if File.exist?("../" + themePath)
# Check for custom app version number
tmpCustomAppVersionNumber = get_info_plist_value(path: themePath, key: "app.version-number")
tmpCustomAppVersionNumber = get_info_plist_value(path: themePath, key: "build.version-number")
if tmpCustomAppVersionNumber && !tmpCustomAppVersionNumber.empty?
customAppVersionNumber = tmpCustomAppVersionNumber

Expand Down
32 changes: 20 additions & 12 deletions ownCloud.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions ownCloud/App Controllers/AppRootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ open class AppRootViewController: EmbeddingViewController, BrowserNavigationView
ClientSessionManager.shared.remove(delegate: self)
}

// MARK: - Interface orientations
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if let contentViewController {
return contentViewController.supportedInterfaceOrientations
}

return super.supportedInterfaceOrientations
}

// MARK: - Status Bar style
open override var childForStatusBarStyle: UIViewController? {
return contentViewController
Expand All @@ -170,6 +179,9 @@ open class AppRootViewController: EmbeddingViewController, BrowserNavigationView
open override var contentViewController: UIViewController? {
didSet {
setNeedsStatusBarAppearanceUpdate()
if #available(iOS 16, *) {
setNeedsUpdateOfSupportedInterfaceOrientations()
}
}
}

Expand Down
65 changes: 0 additions & 65 deletions ownCloud/App Controllers/InitialSetupViewController.swift

This file was deleted.

2 changes: 1 addition & 1 deletion ownCloud/Bookmarks/AccountSettingsProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AccountSettingsProvider: NSObject {
}

var logo: UIImage {
if Branding.shared.isBranded, let image = Branding.shared.brandedImageNamed(.loginLogo) {
if Branding.shared.isBranded, let image = Branding.shared.brandedImageNamed(.brandLogo) ?? Branding.shared.brandedImageNamed(.legacyBrandLogo) {
return image
}

Expand Down
3 changes: 2 additions & 1 deletion ownCloud/Bookmarks/BookmarkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class BookmarkViewController: StaticTableViewController {
logoAndAppNameView.backgroundInsets = NSDirectionalEdgeInsets(top: 20, leading: 20, bottom: 0, trailing: 20)
logoAndAppNameView.elementInsets = NSDirectionalEdgeInsets(top: 30, leading: 20, bottom: 10, trailing: 20)

(logoAndAppNameView.backgroundView as? RoundCornerBackgroundView)?.fillImage = Branding.shared.brandedImageNamed(.loginBackground)
(logoAndAppNameView.backgroundView as? RoundCornerBackgroundView)?.fillImage = Branding.shared.brandedImageNamed(.brandBackground) ?? Branding.shared.brandedImageNamed(.legacyBrandBackground)

self.tableView.tableHeaderView = logoAndAppNameView
self.tableView.layoutTableHeaderView()
Expand Down Expand Up @@ -1154,6 +1154,7 @@ extension BookmarkViewController {
setupViewController.navigationItem.titleLabelText = "Add account".localized

let navigationViewController = ThemeNavigationController(rootViewController: setupViewController)
navigationViewController.modalPresentationStyle = .fullScreen
hostViewController.present(navigationViewController, animated: true, completion: nil)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class BookmarkSetupStepViewController: UIViewController, UITextFieldDelegate {

var titleLabel: UILabel?
var messageLabel: UILabel?
var continueButton: UIButton = UIButton()
var backButton: UIButton = UIButton()
var continueButton: UIButton = ThemeButton(withSelectors: [.filled])
var backButton: UIButton = ThemeCSSButton(withSelectors: [])

var contentContainerView: UIView?
var contentView: UIView? {
Expand Down
58 changes: 29 additions & 29 deletions ownCloud/Bookmarks/Setup/BookmarkSetupViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,25 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele

visibleContentContainerView.translatesAutoresizingMaskIntoConstraints = false

let backgroundView = ThemeCSSView(withSelectors: [.background])
backgroundView.translatesAutoresizingMaskIntoConstraints = false
let brandBackground = BrandView(showBackground: true, showLogo: false, roundedCorners: false, assetSuffix: .setup)

contentView.embed(toFillWith: backgroundView)
contentView.embed(toFillWith: brandBackground)
contentView.embed(toFillWith: visibleContentContainerView, enclosingAnchors: contentView.safeAreaWithKeyboardAnchorSet)

centerHelperView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(centerHelperView)

self.cssSelectors = [.modal, .accountSetup]

// Add login background image
if let image = Branding.shared.brandedImageNamed(.loginBackground) {
let backgroundImageView = UIImageView(image: image)
backgroundImageView.contentMode = .scaleAspectFill
backgroundView.embed(toFillWith: backgroundImageView)
}

// Add logo
let maxLogoSize = CGSize(width: 128, height: 128)
let logoImage = UIImage(named: "branding-login-logo")
var logoImageSize: CGSize?
if let logoImage {
logoImageSize = UIImage.sizeThatFits(logoImage.size, into: maxLogoSize)
logoView = UIImageView(image: logoImage)
if navigationController == nil {
let deviceScreenHeight = UIScreen.main.bounds.height
let logoMaxHeight = deviceScreenHeight < 800 ? (deviceScreenHeight < 600 ? 48 : 96) : 128
let maxLogoSize = CGSize(width: 256, height: logoMaxHeight)
logoView = BrandView(showBackground: false, showLogo: true, logoMaxSize: maxLogoSize, fitToLogo: true, roundedCorners: false, assetSuffix: .setup)
}

if let logoView = logoView as? UIImageView, let logoImageSize {
logoView.cssSelector = .icon
logoView.accessibilityLabel = VendorServices.shared.appName
logoView.contentMode = .scaleAspectFit
logoView.translatesAutoresizingMaskIntoConstraints = false

if let logoView {
contentView.addSubview(logoView)

NSLayoutConstraint.activate([
Expand All @@ -97,9 +83,7 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele
centerHelperView.heightAnchor.constraint(greaterThanOrEqualToConstant: 1),

logoView.topAnchor.constraint(equalTo: centerHelperView.topAnchor),
logoView.centerXAnchor.constraint(equalTo: centerHelperView.centerXAnchor),
logoView.widthAnchor.constraint(equalToConstant: logoImageSize.width),
logoView.heightAnchor.constraint(lessThanOrEqualToConstant: logoImageSize.height)
logoView.centerXAnchor.constraint(equalTo: centerHelperView.centerXAnchor)
])
}

Expand Down Expand Up @@ -167,6 +151,14 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele
composer?.updateState()
}

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [.portrait, .portraitUpsideDown]
}

override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}

override var preferredStatusBarStyle : UIStatusBarStyle {
return Theme.shared.activeCollection.css.getStatusBarStyle(for: self) ?? .default
}
Expand Down Expand Up @@ -250,7 +242,12 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele

didSet {
if let hudMessageView {
visibleContentContainerView.embed(centered: hudMessageView, minimumInsets: NSDirectionalEdgeInsets(top: 20, leading: 20, bottom: 20, trailing: 20))
visibleContentContainerView.addSubview(hudMessageView)
NSLayoutConstraint.activate([
hudMessageView.centerYAnchor.constraint(equalTo: visibleContentContainerView.centerYAnchor),
hudMessageView.leadingAnchor.constraint(equalTo: visibleContentContainerView.safeAreaLayoutGuide.leadingAnchor, constant: 20),
hudMessageView.trailingAnchor.constraint(equalTo: visibleContentContainerView.safeAreaLayoutGuide.trailingAnchor, constant: -20)
])
contentViewController?.view.isHidden = true
logoView?.isHidden = true
}
Expand Down Expand Up @@ -309,10 +306,13 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele
let indeterminateProgress = Progress.indeterminate()
indeterminateProgress.isCancellable = false

self.hudMessageView = ComposedMessageView(elements: [
.progressCircle(with: indeterminateProgress),
.title(hudMessage)
let messageView = ComposedMessageView.infoBox(additionalElements: [
.progressCircle(with: indeterminateProgress, alignment: .centered),
.spacing(10),
.text(hudMessage, style: .system(textStyle: .headline, weight: .bold), alignment: .centered)
])
messageView.cssSelectors = [ .step ]
self.hudMessageView = messageView
} else {
self.hudMessageView = nil
}
Expand Down
14 changes: 9 additions & 5 deletions ownCloud/Client/Viewer/DisplayHostViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ class DisplayHostViewController: UIPageViewController {
}

// MARK: - Active Viewer
private var _navigationTitleObservation : NSKeyValueObservation?
private var _navigationItemObservation : NSKeyValueObservation?
private var _navigationBarButtonItemsObservation : NSKeyValueObservation?

weak var activeDisplayViewController : DisplayViewController? {
willSet {
_navigationTitleObservation?.invalidate()
_navigationTitleObservation = nil
_navigationItemObservation?.invalidate()
_navigationItemObservation = nil

_navigationBarButtonItemsObservation?.invalidate()
_navigationBarButtonItemsObservation = nil
Expand All @@ -191,8 +191,12 @@ class DisplayHostViewController: UIPageViewController {
didSet {
Log.debug("New activeDisplayViewController: \(activeDisplayViewController?.item?.name ?? "-")")

_navigationTitleObservation = activeDisplayViewController?.observe(\DisplayViewController.displayTitle, options: .initial, changeHandler: { [weak self] (displayViewController, _) in
self?.navigationItem.title = displayViewController.displayTitle
_navigationItemObservation = activeDisplayViewController?.observe(\DisplayViewController.item, options: .initial, changeHandler: { [weak self] (displayViewController, _) in
if let itemLocation = displayViewController.item?.location, let clientContext = displayViewController.clientContext {
OnMainThread(inline: true) {
self?.navigationItem.titleView = ClientLocationPopupButton(clientContext: clientContext, location: itemLocation)
}
}
})

_navigationBarButtonItemsObservation = activeDisplayViewController?.observe(\DisplayViewController.displayBarButtonItems, options: .initial, changeHandler: { [weak self] (displayViewController, _) in
Expand Down
6 changes: 3 additions & 3 deletions ownCloud/Client/Viewer/DisplayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class DisplayViewController: UIViewController, Themeable, OCQueryDelegate {
return nil
}

var item: OCItem? {
@objc dynamic var item: OCItem? {
didSet {
if itemClaimIdentifier == nil, // No claim registered by the DisplayViewController for the item yet
let item = item, let core = core,
Expand Down Expand Up @@ -477,8 +477,8 @@ class DisplayViewController: UIViewController, Themeable, OCQueryDelegate {
}

// MARK: - UI management
@objc var displayTitle : String?
@objc var displayBarButtonItems : [UIBarButtonItem]?
@objc dynamic var displayTitle : String?
@objc dynamic var displayBarButtonItems : [UIBarButtonItem]?

private func updateDisplayTitleAndButtons() {
if let itemName = item?.name {
Expand Down
Loading

0 comments on commit 2607e37

Please sign in to comment.