Skip to content

Commit

Permalink
- Made dissapear all the non-needed UI elements in DisplayViewControl…
Browse files Browse the repository at this point in the history
…ler when a

file is presented.
- Improved accessibility on some labels.
  • Loading branch information
pablocarmu committed Jan 29, 2019
1 parent 532b02c commit 9f99862
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
7 changes: 5 additions & 2 deletions ownCloud/Client/ClientItemCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ class ClientItemCell: ThemeTableViewCell {
iconView.contentMode = .scaleAspectFit
moreButton.translatesAutoresizingMaskIntoConstraints = false

titleLabel.font = UIFont.systemFont(ofSize: 17, weight: UIFont.Weight.semibold)
detailLabel.font = UIFont.systemFont(ofSize: 14)
titleLabel.font = UIFont.preferredFont(forTextStyle: .headline)
titleLabel.adjustsFontForContentSizeCategory = true

detailLabel.font = UIFont.preferredFont(forTextStyle: .footnote)
detailLabel.adjustsFontForContentSizeCategory = true

detailLabel.textColor = UIColor.gray

Expand Down
2 changes: 1 addition & 1 deletion ownCloud/Server List/ServerListBookmarkCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ServerListBookmarkCell : ThemeTableViewCell {
iconView.translatesAutoresizingMaskIntoConstraints = false
iconView.contentMode = .scaleAspectFit

titleLabel.font = UIFont.preferredFont(forTextStyle: .body)
titleLabel.font = UIFont.preferredFont(forTextStyle: .headline)
titleLabel.adjustsFontForContentSizeCategory = true

detailLabel.font = UIFont.preferredFont(forTextStyle: .subheadline)
Expand Down
12 changes: 11 additions & 1 deletion ownCloud/Viewer/DisplayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class DisplayViewController: UIViewController {
OnMainThread {
self.iconImageView.isHidden = true
}
hideUIElements()
renderSpecificView()
}
}
Expand Down Expand Up @@ -214,7 +215,7 @@ class DisplayViewController: UIViewController {

parent.navigationItem.title = item.name
let actionsBarButtonItem = UIBarButtonItem(title: "•••", style: .plain, target: self, action: #selector(optionsBarButtonPressed))
actionsBarButtonItem.accessibilityLabel = item.name + " " + "Actions".localized
actionsBarButtonItem.accessibilityLabel = item.name! + " " + "Actions".localized
parent.navigationItem.rightBarButtonItem = actionsBarButtonItem
}

Expand Down Expand Up @@ -248,6 +249,15 @@ class DisplayViewController: UIViewController {
// This function is intended to be overwritten by the subclases to implement a custom view based on the source property.s
}

func hideUIElements() {
iconImageView.isHidden = true
progressView?.isHidden = true
cancelButton?.isHidden = true
metadataInfoLabel?.isHidden = true
showPreviewButton?.isHidden = true
noNetworkLabel?.isHidden = true
}

// MARK: - KVO observing
// swiftlint:disable block_based_kvo
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
Expand Down

0 comments on commit 9f99862

Please sign in to comment.