-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - Created the MoreViewController for the More Screen following the design guidelines described in #82 - Created new init methods in StaticTableViewRow and StaticTableViewSection to support NSAttributedString as titles. - Created new UIPresentationController called CardPresentationController to support the presentation of a view controller in a "card" way. - Coded support for NSAttributedString in ThemeTableViewCell. * - Decoupled the MoreViewController into 3 different files * - Little tweak in CardPresentationController for landscape on iPhone. - Coded the size of the item as detail label in the more header. * - SDK Updated to file management branch to be able to use progress. - Coded the rename feature using the more view. * - Made the detail font size match the proposed design. - Now the detail label in the MoreHeaderView shows the last modified date of an OCItem. * - Turn on scrolling for MoreStaticTableViewController created in ClientQueryViewController - Figured out card-style scrolling: - until the card is fully "open": all pan gestures move the card - once the card is fully "open": - pans in UIScrollView upwards scroll the scrollView up - pans in UIScrollView downwards - scroll the scrollView down if its position is not already at the top - move the card if the scrollView's position is already at the top * - Improved support for themes inside the MoreStaticTableViewController. * - CardPresentationController now respects the size of the content, can't be extended beyond the maximum size of the content - Make MoreStaticTableViewController adopt dynamic sizing/auto layout - Fix formatting - Fix SwiftLint warnings - Add missing license texts * - avoid creating gesture recognizers that aren't used and clarify cardPanGestureRecognizer and dimmingViewGestureRecognizer types - add overStretchView that is attached below the presentedView - make sure containerViewWillLayoutSubviews isn't interferring with animations / user drags - considering that the card won't permanently extend beyond the size of the card, default the cardPosition to .open to show as much of the card as possible * - Move dragHandleView into CardPresentationController - Make taps on the drag handle dismiss the card - Add support for iPhone X safe areas to CardPresentationController - CardPresentationController dynamically makes MoreViewController disable scrolling if it fits entirely on screen - unified dismiss code - added convenience method to UIViewController to quickly present a view controller as a card - cleaned up static table view code and made the moreViewController use "buttonWithAction" - added support for non-opaque buttons to StaticTableViewRow - cleaned up MoreViewController constraints and fixed an exception/warning during rotation - fixed thumbnail size in MoreViewHeader - rewrote MoreViewHandler constraint code - Fix indentations in various places * - avoid duplicate code for rename and delete inside ClientQueryViewController - ClientQueryViewController gains new methods for folder creation, rename and delete - added titles to "New folder" and "Rename" actions - fix missing spacing of sortbar when rotating in iPhone X and using in landscape - improved text in alerts - remove NSAttributedStringKey extension as its no longer needed * Moving headerAttributedTitle and footerAttributedTitle support from StaticTableViewSection to MoreStaticTableViewSection, as the properties are only used by MoreStaticTableViewController.
- Loading branch information
1 parent
3f828c6
commit b8c0e2c
Showing
17 changed files
with
1,009 additions
and
124 deletions.
There are no files selected for viewing
Submodule ios-sdk
updated
71 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
ownCloud/Client/Actions/MoreStaticTableViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// MoreStaticTableViewController.swift | ||
// ownCloud | ||
// | ||
// Created by Pablo Carrascal on 17/08/2018. | ||
// Copyright © 2018 ownCloud GmbH. All rights reserved. | ||
// | ||
|
||
/* | ||
* Copyright (C) 2018, ownCloud GmbH. | ||
* | ||
* This code is covered by the GNU Public License Version 3. | ||
* | ||
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ | ||
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>. | ||
* | ||
*/ | ||
|
||
import UIKit | ||
|
||
class MoreStaticTableViewController: StaticTableViewController { | ||
|
||
private var themeApplierTokens: [ThemeApplierToken] | ||
|
||
override init(style: UITableViewStyle) { | ||
themeApplierTokens = [] | ||
super.init(style: style) | ||
} | ||
|
||
deinit { | ||
themeApplierTokens.forEach({ | ||
Theme.shared.remove(applierForToken: $0) | ||
}) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { | ||
if let title = (sections[section] as? MoreStaticTableViewSection)?.headerAttributedTitle { | ||
let containerView = UIView() | ||
let label = UILabel() | ||
label.translatesAutoresizingMaskIntoConstraints = false | ||
containerView.addSubview(label) | ||
NSLayoutConstraint.activate([ | ||
label.leftAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.leftAnchor, constant: 20), | ||
label.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 10), | ||
label.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: -10), | ||
label.rightAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.rightAnchor, constant: -20) | ||
]) | ||
|
||
label.attributedText = title | ||
|
||
let messageApplierToken = Theme.shared.add(applier: { (_, collection, _) in | ||
label.applyThemeCollection(collection) | ||
}) | ||
|
||
themeApplierTokens.append(messageApplierToken) | ||
|
||
return containerView | ||
} | ||
|
||
return nil | ||
} | ||
|
||
override func applyThemeCollection(theme: Theme, collection: ThemeCollection, event: ThemeEvent) { | ||
super.applyThemeCollection(theme: theme, collection: collection, event: event) | ||
self.tableView.separatorColor = self.tableView.backgroundColor | ||
} | ||
} | ||
|
||
class MoreStaticTableViewSection : StaticTableViewSection { | ||
public var headerAttributedTitle : NSAttributedString? | ||
public var footerAttributedTitle : NSAttributedString? | ||
|
||
convenience init(headerAttributedTitle theHeaderTitle: NSAttributedString, footerAttributedTitle theFooterTitle: NSAttributedString? = nil, identifier : String? = nil, rows rowsToAdd: [StaticTableViewRow] = Array()) { | ||
self.init() | ||
|
||
self.headerAttributedTitle = theHeaderTitle | ||
self.footerAttributedTitle = theFooterTitle | ||
|
||
self.identifier = identifier | ||
|
||
self.add(rows: rowsToAdd) | ||
} | ||
} |
Oops, something went wrong.