Skip to content
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
2 changes: 1 addition & 1 deletion ownCloud/Client/Viewer/DisplayHostViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ extension DisplayHostViewController: UIPageViewControllerDelegate {

extension DisplayHostViewController: Themeable {
func applyThemeCollection(theme: Theme, collection: ThemeCollection, event: ThemeEvent) {
self.view.backgroundColor = .black
self.view.backgroundColor = collection.tableBackgroundColor
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/icon-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/icon-29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/icon-40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/icon-76.png
Binary file modified ownCloud/Resources/Theming/branding-splashscreen-background.png
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,14 @@ open class ClientQueryViewController: QueryFileListTableViewController, UIDropIn
self.tableView.dropDelegate = self
self.tableView.dragInteractionEnabled = true

folderActionBarButton = UIBarButtonItem(image: UIImage(named: "more-dots"), style: .plain, target: self, action: #selector(moreBarButtonPressed))
var rightInset : CGFloat = 4
var leftInset : CGFloat = 0
if self.view.effectiveUserInterfaceLayoutDirection == .rightToLeft {
rightInset = 0
leftInset = 3
}

folderActionBarButton = UIBarButtonItem(image: UIImage(named: "more-dots")?.withInset(UIEdgeInsets(top: 0, left: leftInset, bottom: 0, right: rightInset)), style: .plain, target: self, action: #selector(moreBarButtonPressed))
folderActionBarButton?.accessibilityIdentifier = "client.folder-action"
folderActionBarButton?.accessibilityLabel = "Actions".localized
plusBarButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(plusBarButtonPressed))
Expand Down
10 changes: 8 additions & 2 deletions ownCloudAppShared/Client/User Interface/SortBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class SortBar: UIView, Themeable, UIPopoverPresentationControllerDelegate
let sideButtonsSize: CGSize = CGSize(width: 44.0, height: 44.0)
let leftPadding: CGFloat = 20.0
let rightPadding: CGFloat = 20.0
let rightSelectButtonPadding: CGFloat = 8.0
let topPadding: CGFloat = 10.0
let bottomPadding: CGFloat = 10.0

Expand Down Expand Up @@ -191,7 +192,7 @@ public class SortBar: UIView, Themeable, UIPopoverPresentationControllerDelegate

NSLayoutConstraint.activate([
selectButton.centerYAnchor.constraint(equalTo: self.centerYAnchor),
selectButton.trailingAnchor.constraint(lessThanOrEqualTo: self.safeAreaLayoutGuide.trailingAnchor, constant: -rightPadding),
selectButton.trailingAnchor.constraint(lessThanOrEqualTo: self.safeAreaLayoutGuide.trailingAnchor, constant: -rightSelectButtonPadding),
selectButton.heightAnchor.constraint(equalToConstant: sideButtonsSize.height),
selectButton.widthAnchor.constraint(equalToConstant: sideButtonsSize.width)
])
Expand Down Expand Up @@ -287,7 +288,12 @@ public class SortBar: UIView, Themeable, UIPopoverPresentationControllerDelegate
let popoverPresentationController = tableViewController.popoverPresentationController
popoverPresentationController?.sourceView = sender
popoverPresentationController?.delegate = self
popoverPresentationController?.sourceRect = CGRect(x: 0, y: 0, width: sender.frame.size.width, height: sender.frame.size.height)

if self.effectiveUserInterfaceLayoutDirection == .rightToLeft {
popoverPresentationController?.sourceRect = CGRect(x: 5, y: 0, width: 10, height: sender.frame.size.height)
} else {
popoverPresentationController?.sourceRect = CGRect(x: sender.frame.size.width - 12, y: 0, width: 10, height: sender.frame.size.height)
}
popoverPresentationController?.permittedArrowDirections = .up

delegate?.sortBar(self, presentViewController: tableViewController, animated: true, completionHandler: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,28 @@ class SortMethodTableViewController: StaticTableViewController {

var rows : [StaticTableViewRow] = []
let contentHeight : CGFloat = rowHeight * CGFloat(SortMethod.all.count) - 1
let contentWidth : CGFloat = (view.frame.size.width < maxContentWidth) ? view.frame.size.width : maxContentWidth
let contentWidth : CGFloat = maxContentWidth
self.preferredContentSize = CGSize(width: contentWidth, height: contentHeight)

for method in SortMethod.all {
var title = method.localizedName()
let title = method.localizedName()
var sortDirectionTitle = ""

if sortBarDelegate?.sortMethod == method {
if sortBarDelegate?.sortDirection == .ascendant { // Show arrows opposite to the current sort direction to show what choosing them will lead to
title = String(format: "%@ ↓", method.localizedName())
sortDirectionTitle = "↓"
} else {
title = String(format: "%@ ↑", method.localizedName())
sortDirectionTitle = "↑"
}
}

let aRow = StaticTableViewRow(rowWithAction: { [weak self] (_, _) in
let aRow = StaticTableViewRow(subtitleRowWithAction: { [weak self] (_, _) in
guard let self = self else { return }

self.sortBar?.sortMethod = method

self.dismiss(animated: false, completion: nil)
}, title: title)
}, title: title, subtitle: sortDirectionTitle, style: .value1, accessoryType: .none, identifier: nil, withButtonStyle: true)
rows.append(aRow)
}

Expand Down
13 changes: 13 additions & 0 deletions ownCloudAppShared/UIKit Extension/UIImage+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,17 @@ public extension UIImage {

return image
}

func withInset(_ insets: UIEdgeInsets) -> UIImage? {
let cgSize = CGSize(width: self.size.width + insets.left * self.scale + insets.right * self.scale,
height: self.size.height + insets.top * self.scale + insets.bottom * self.scale)

UIGraphicsBeginImageContextWithOptions(cgSize, false, self.scale)
defer { UIGraphicsEndImageContext() }

let origin = CGPoint(x: insets.left * self.scale, y: insets.top * self.scale)
self.draw(at: origin)

return UIGraphicsGetImageFromCurrentImageContext()?.withRenderingMode(self.renderingMode)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,12 @@ open class StaticTableViewRow : NSObject, UITextFieldDelegate {
})
}

convenience public init(subtitleRowWithAction: StaticTableViewRowAction?, title: String, subtitle: String? = nil, style : UITableViewCell.CellStyle = .subtitle, accessoryType: UITableViewCell.AccessoryType = UITableViewCell.AccessoryType.none, identifier : String? = nil) {
convenience public init(subtitleRowWithAction: StaticTableViewRowAction?, title: String, subtitle: String? = nil, style : UITableViewCell.CellStyle = .subtitle, accessoryType: UITableViewCell.AccessoryType = UITableViewCell.AccessoryType.none, identifier : String? = nil, withButtonStyle : Bool = false) {
self.init()
type = .subtitleRow

self.identifier = identifier

self.cell = ThemeTableViewCell(style: style, reuseIdentifier: nil)
self.cell = ThemeTableViewCell(withLabelColorUpdates: !withButtonStyle, style: style, reuseIdentifier: nil)
self.cell?.textLabel?.text = title
self.cell?.detailTextLabel?.text = subtitle
self.cell?.accessoryType = accessoryType
Expand All @@ -289,6 +288,18 @@ open class StaticTableViewRow : NSObject, UITextFieldDelegate {
row.cell?.detailTextLabel?.text = value
}
}

if withButtonStyle {
themeApplierToken = Theme.shared.add(applier: { [weak self] (_, themeCollection, _) in
let textColor = themeCollection.tintColor

self?.cell?.textLabel?.textColor = textColor
self?.cell?.detailTextLabel?.textColor = textColor

self?.cell?.textLabel?.highlightedTextColor = themeCollection.tableRowHighlightColors.labelColor
self?.cell?.detailTextLabel?.highlightedTextColor = themeCollection.tableRowHighlightColors.labelColor
}, applyImmediately: true)
}
}

convenience public init(valueRowWithAction: StaticTableViewRowAction?, title: String, value: String, accessoryType: UITableViewCell.AccessoryType = UITableViewCell.AccessoryType.none, identifier : String? = nil) {
Expand Down Expand Up @@ -751,12 +762,10 @@ open class StaticTableViewRow : NSObject, UITextFieldDelegate {
self?.cell?.tintColor = themeCollection.tintColor

if selectedTextColor != nil {

self?.cell?.textLabel?.highlightedTextColor = selectedTextColor
}

if backgroundColor != nil {

self?.cell?.backgroundColor = backgroundColor
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public extension NSObject {
if let tabBar = self as? UITabBar {
tabBar.barTintColor = collection.toolbarColors.backgroundColor
tabBar.tintColor = collection.toolbarColors.tintColor
tabBar.unselectedItemTintColor = collection.toolbarColors.filledColorPairCollection.normal.foreground.darker(0.25)
tabBar.unselectedItemTintColor = collection.toolbarColors.secondaryLabelColor
}

if let tableView = self as? UITableView {
Expand Down
17 changes: 9 additions & 8 deletions ownCloudAppShared/User Interface/Theme/ThemeCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public class ThemeCollection : NSObject {

self.darkBrandColors = colors.resolveThemeColorCollection("darkBrandColors", ThemeColorCollection(
backgroundColor: darkColor,
tintColor: lightColor.lighter(0.2),
tintColor: lightColor,
labelColor: UIColor.white,
secondaryLabelColor: UIColor.lightGray,
symbolColor: UIColor.white,
Expand Down Expand Up @@ -238,18 +238,18 @@ public class ThemeCollection : NSObject {
self.tableRowColors = colors.resolveThemeColorCollection("Table.tableRowColors", ThemeColorCollection(
backgroundColor: tableBackgroundColor,
tintColor: nil,
labelColor: UIColor.black,
secondaryLabelColor: UIColor.gray,
symbolColor: darkColor,
labelColor: darkColor,
secondaryLabelColor: UIColor(hex: 0x475770),
symbolColor: UIColor(hex: 0x475770),
filledColorPairCollection: ThemeColorPairCollection(fromPair: ThemeColorPair(foreground: UIColor.white, background: lightBrandColor))
))

self.tableRowHighlightColors = colors.resolveThemeColorCollection("Table.tableRowHighlightColors", ThemeColorCollection(
backgroundColor: UIColor.white.darker(0.1),
tintColor: nil,
labelColor: UIColor.black,
secondaryLabelColor: UIColor.gray,
symbolColor: darkColor,
labelColor: darkColor,
secondaryLabelColor: UIColor(hex: 0x475770),
symbolColor: UIColor(hex: 0x475770),
filledColorPairCollection: ThemeColorPairCollection(fromPair: ThemeColorPair(foreground: UIColor.white, background: lightBrandColor))
))

Expand Down Expand Up @@ -320,7 +320,7 @@ public class ThemeCollection : NSObject {
self.navigationBarColors = colors.resolveThemeColorCollection("NavigationBar", ThemeColorCollection(
backgroundColor: UIColor.white.darker(0.05),
tintColor: nil,
labelColor: UIColor.black,
labelColor: darkColor,
secondaryLabelColor: UIColor.gray,
symbolColor: darkColor,
filledColorPairCollection: ThemeColorPairCollection(fromPair: ThemeColorPair(foreground: UIColor.white, background: lightBrandColor))
Expand Down Expand Up @@ -358,6 +358,7 @@ public class ThemeCollection : NSObject {
// Bars
self.navigationBarColors = colors.resolveThemeColorCollection("NavigationBar", self.darkBrandColors)
self.toolbarColors = colors.resolveThemeColorCollection("Toolbar", self.darkBrandColors)
self.toolbarColors.secondaryLabelColor = .lightGray
self.searchBarColors = colors.resolveThemeColorCollection("Searchbar", self.darkBrandColors)
self.loginColors = colors.resolveThemeColorCollection("Login", self.darkBrandColors)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import ownCloudSDK

// MARK: - ownCloud brand colors
extension UIColor {
static var ownCloudLightColor : UIColor { return UIColor(hex: 0x468CC8) }
static var ownCloudDarkColor : UIColor { return UIColor(hex: 0x1D293B) }
static var ownCloudLightColor : UIColor { return UIColor(hex: 0x4E85C8) }
static var ownCloudDarkColor : UIColor { return UIColor(hex: 0x041E42) }
}

extension ThemeStyle {
Expand Down