Make responsive to dynamic font changes.

This commit is contained in:
Maurice Parker 2019-04-29 14:50:56 -05:00
parent e37d4ddd2f
commit b4e2acb5ce
2 changed files with 17 additions and 5 deletions

View File

@ -25,20 +25,27 @@ struct MasterTimelineCellLayout {
static let avatarCornerRadius = CGFloat(integerLiteral: 4)
static let titleColor = AppAssets.timelineTextPrimaryColor
static let titleFont = UIFont.preferredFont(forTextStyle: .headline)
static var titleFont: UIFont {
return UIFont.preferredFont(forTextStyle: .headline)
}
static let titleBottomMargin = CGFloat(integerLiteral: 1)
static let feedColor = AppAssets.timelineTextSecondaryColor
static let feedNameFont = UIFont.preferredFont(forTextStyle: .footnote)
static var feedNameFont: UIFont {
return UIFont.preferredFont(forTextStyle: .footnote)
}
static let feedRightMargin = CGFloat(integerLiteral: 8)
static let dateColor = AppAssets.timelineTextSecondaryColor
static let dateFont = UIFont.preferredFont(forTextStyle: .footnote)
static var dateFont: UIFont {
return UIFont.preferredFont(forTextStyle: .footnote)
}
static let dateMarginBottom = CGFloat(integerLiteral: 1)
static let summaryColor = AppAssets.timelineTextPrimaryColor
static let summaryFont = UIFont.preferredFont(forTextStyle: .body)
static var summaryFont: UIFont {
return UIFont.preferredFont(forTextStyle: .body)
}
static let chevronWidth = CGFloat(integerLiteral: 28)

View File

@ -40,6 +40,7 @@ class MasterTimelineViewController: ProgressTableViewController, UndoableCommand
NotificationCenter.default.addObserver(self, selector: #selector(articleDataDidChange(_:)), name: .ArticleDataDidChange, object: navState)
NotificationCenter.default.addObserver(self, selector: #selector(articlesDidChange(_:)), name: .ArticlesDidChange, object: navState)
NotificationCenter.default.addObserver(self, selector: #selector(articleSelectionDidChange(_:)), name: .ArticleSelectionDidChange, object: navState)
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
refreshControl = UIRefreshControl()
refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged)
@ -268,6 +269,10 @@ class MasterTimelineViewController: ProgressTableViewController, UndoableCommand
}
@objc func contentSizeCategoryDidChange(_ note: Notification) {
tableView.reloadData()
}
// MARK: Reloading
@objc func reloadAllVisibleCells() {