mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 09:18:18 +00:00
💄 Liquid Glass Redesign for NetNewsWire
💄 Add `MainFeedCollectionViewController` 💄 Add and hook up UICollectionView in Storyboard 🚧 Collection view loads temp cells 🚧 UICollectionView - Adds capsule shape for iPad selection - Add filter button, newItem button, settings button - Configures the collection view based on platform - implementsDidSelectItem at - Clears cell background on iPad - Adds cell textColor for iPad - Storyboard changes 🚧 Adds unread count and favicon support 🚧 Smartfeed icons now display 🚧 iPhone cells are consistent in light/dark mode 💄 Sidebar modernised Known bug: Sidebar text doesn’t adapt to dark/light mode changes on iPad 💄 Modern Sidebars Fixes some accessibilty issues and adds swipe actions. 🩹 Become firstResponder 🩹 Workaround #4691 💡 Remove print statement 💄 Fixes to storyboard - adjusts constraints on timeline header view - launch screens now adopt look of liquid glass Restore coordinator behaviour ⚡️ Tweaks to MainFeedCollectionViewController - On iPhone, returning to the feeds view deselect the current feed with an animation. - On iPhone, prefers large titles defaults to `false` - Capsule background with smaller corner radius for iPhone added for selected status. 🩹 Fixes folder height 💄 Fix unread count vertical alignment 💄 Restores header & use UICellConfigurationState 💄 Sidebar tweaks 💄 Folders now highlight on as drop target 💄 Sidebar fixes - Moves more code to cell configuation state - Allows sidebar to move to larger sizes 🩹 Fixes #4694 folder expansion using keyboard 💄 Adds new cell types for the Timeline ♻️ Remove dead code and re-orders to viewWillApp 🩹 Reordering of code from viewWA to viewDA 💄 Removes unused code, tweaks layout 💄 Multiple tweaks to sidebar and timeline 💄 Add missing constraint ♿️ Puts timeline metadata in a stackview 🎨 Adds stackview function 💄 🚑️ Moves to modern UISliders Timeline customiser now uses modern UISliders as they have tickmark functionality. `TickMarkSlider` marked as deprecated. 💄 Make All Unread cell icon tint correctly 💄 Extend edges under opaque bars on timeline 💄 Image View Controller uses modern button style 🚚 Renames `MainTimelinePseudoFeedCell` 💄 Improve feed selection animations 🩹 Use shouldSelectItem to handle selection logic 🩹 Fix fill settings for stack view 💄 Comment out usage of MainTimelineTitleView 🔧 Remove iOS cells from macOS target 💄 Give columns some flexibility 💄 Fix chevron size and alignment 💄 Don’t prefer large navigation bar titles They create a delay in animation on iPhone. 🩹 Fixes nav bar subtitle performance 🎨 Minor refactor - Switch logic in cell state - Prefer traitCollection.userInterfaceIdiom ➕ Add updated mac code for the About view 💄 NSGlassVisualEffectView for About
This commit is contained in:
35 files changed
+3408
-299
No files matched your search
@@ -145,8 +145,7 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
]
|
||||
navigationItem.searchController = searchController
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
// FIXME: iPad scope buttons aren't showing in iOS 26 Beta 1. Set to All Articles.
|
||||
if traitCollection.userInterfaceIdiom == .pad {
|
||||
searchController.searchBar.selectedScopeButtonIndex = 1
|
||||
navigationItem.searchBarPlacementAllowsExternalIntegration = true
|
||||
}
|
||||
@@ -154,16 +153,11 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
|
||||
// Configure the table
|
||||
tableView.dataSource = dataSource
|
||||
if #available(iOS 15.0, *) {
|
||||
tableView.isPrefetchingEnabled = false
|
||||
}
|
||||
tableView.isPrefetchingEnabled = false
|
||||
|
||||
numberOfTextLines = AppDefaults.shared.timelineNumberOfLines
|
||||
iconSize = AppDefaults.shared.timelineIconSize
|
||||
resetEstimatedRowHeight()
|
||||
|
||||
if let titleView = Bundle.main.loadNibNamed("MainTimelineTitleView", owner: self, options: nil)?[0] as? MainTimelineTitleView {
|
||||
navigationItem.titleView = titleView
|
||||
}
|
||||
|
||||
refreshControl = UIRefreshControl()
|
||||
refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged)
|
||||
@@ -179,24 +173,22 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
}
|
||||
|
||||
// Disable swipe back on iPad Mice
|
||||
if #available(iOS 13.4, *) {
|
||||
guard let gesture = self.navigationController?.interactivePopGestureRecognizer as? UIPanGestureRecognizer else {
|
||||
return
|
||||
}
|
||||
gesture.allowedScrollTypesMask = []
|
||||
guard let gesture = self.navigationController?.interactivePopGestureRecognizer as? UIPanGestureRecognizer else {
|
||||
return
|
||||
}
|
||||
gesture.allowedScrollTypesMask = []
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.isToolbarHidden = false
|
||||
|
||||
// If the nav bar is hidden, fade it in to avoid it showing stuff as it is getting laid out
|
||||
if navigationController?.navigationBar.isHidden ?? false {
|
||||
navigationController?.navigationBar.alpha = 0
|
||||
}
|
||||
|
||||
super.viewWillAppear(animated)
|
||||
navigationItem.subtitle = "" // don't inherit feeds subtitle on push
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
@@ -207,6 +199,14 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
self.navigationController?.navigationBar.alpha = 1
|
||||
}
|
||||
}
|
||||
if traitCollection.userInterfaceIdiom == .phone {
|
||||
if let _ = coordinator?.currentArticle {
|
||||
if let indexPath = tableView.indexPathForSelectedRow {
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
}
|
||||
coordinator?.selectArticle(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
@@ -536,8 +536,13 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
|
||||
for article in visibleUpdatedArticles {
|
||||
if let indexPath = dataSource.indexPath(for: article) {
|
||||
if let cell = tableView.cellForRow(at: indexPath) as? MainTimelineTableViewCell {
|
||||
configure(cell, article: article)
|
||||
if let cell = tableView.cellForRow(at: indexPath) as? MainTimelineIconFeedCell {
|
||||
let cellData = configure(article: article)
|
||||
cell.cellData = cellData
|
||||
}
|
||||
if let cell = tableView.cellForRow(at: indexPath) as? MainTimelineFeedCell {
|
||||
let cellData = configure(article: article)
|
||||
cell.cellData = cellData
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -556,8 +561,10 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath) else {
|
||||
return
|
||||
}
|
||||
if article.webFeed == feed, let cell = tableView.cellForRow(at: indexPath) as? MainTimelineTableViewCell, let image = iconImageFor(article) {
|
||||
cell.setIconImage(image)
|
||||
if article.webFeed == feed {
|
||||
if let cell = tableView.cellForRow(at: indexPath) as? MainTimelineIconFeedCell, let image = iconImageFor(article) {
|
||||
cell.setIconImage(image)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -702,41 +709,41 @@ private extension MainTimelineViewController {
|
||||
}
|
||||
|
||||
func configureToolbar() {
|
||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||
if traitCollection.userInterfaceIdiom == .phone {
|
||||
toolbarItems?.insert(.flexibleSpace(), at: 1)
|
||||
toolbarItems?.insert(navigationItem.searchBarPlacementBarButtonItem, at: 2)
|
||||
}
|
||||
}
|
||||
|
||||
func resetUI(resetScroll: Bool) {
|
||||
|
||||
title = timelineFeed?.nameForDisplay ?? "Timeline"
|
||||
tableView.reloadData()
|
||||
|
||||
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||
titleView.iconView?.iconImage = timelineIconImage
|
||||
if let preferredColor = timelineIconImage?.preferredColor {
|
||||
titleView.iconView?.tintColor = UIColor(cgColor: preferredColor)
|
||||
} else {
|
||||
titleView.iconView?.tintColor = nil
|
||||
}
|
||||
|
||||
titleView.label?.text = timelineFeed?.nameForDisplay
|
||||
updateTitleUnreadCount()
|
||||
|
||||
if timelineFeed is WebFeed {
|
||||
titleView.buttonize()
|
||||
titleView.addGestureRecognizer(feedTapGestureRecognizer)
|
||||
} else {
|
||||
titleView.debuttonize()
|
||||
titleView.removeGestureRecognizer(feedTapGestureRecognizer)
|
||||
}
|
||||
|
||||
navigationItem.titleView = titleView
|
||||
}
|
||||
// if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||
// titleView.iconView?.iconImage = timelineIconImage
|
||||
// if let preferredColor = timelineIconImage?.preferredColor {
|
||||
// titleView.iconView?.tintColor = UIColor(cgColor: preferredColor)
|
||||
// } else {
|
||||
// titleView.iconView?.tintColor = nil
|
||||
// }
|
||||
//
|
||||
// titleView.label?.text = timelineFeed?.nameForDisplay
|
||||
// updateTitleUnreadCount()
|
||||
//
|
||||
// if timelineFeed is WebFeed {
|
||||
// titleView.buttonize()
|
||||
// titleView.addGestureRecognizer(feedTapGestureRecognizer)
|
||||
// } else {
|
||||
// titleView.debuttonize()
|
||||
// titleView.removeGestureRecognizer(feedTapGestureRecognizer)
|
||||
// }
|
||||
//
|
||||
// navigationItem.titleView = titleView
|
||||
// }
|
||||
|
||||
switch timelineDefaultReadFilterType {
|
||||
case .none, .read:
|
||||
navigationItem.rightBarButtonItem = filterButton
|
||||
navigationItem.rightBarButtonItem?.isEnabled = true
|
||||
case .alwaysRead:
|
||||
navigationItem.rightBarButtonItem = nil
|
||||
}
|
||||
@@ -807,22 +814,29 @@ private extension MainTimelineViewController {
|
||||
func makeDataSource() -> UITableViewDiffableDataSource<Int, Article> {
|
||||
let dataSource: UITableViewDiffableDataSource<Int, Article> =
|
||||
MainTimelineDataSource(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, article in
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MainTimelineTableViewCell
|
||||
self?.configure(cell, article: article)
|
||||
return cell
|
||||
let cellData = self!.configure(article: article)
|
||||
if self!.showIcons {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "MainTimelinePseudoFeedCell", for: indexPath) as! MainTimelineIconFeedCell
|
||||
cell.cellData = cellData
|
||||
return cell
|
||||
} else {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "MainTimelineFeedCell", for: indexPath) as! MainTimelineFeedCell
|
||||
cell.cellData = cellData
|
||||
return cell
|
||||
}
|
||||
|
||||
})
|
||||
dataSource.defaultRowAnimation = .middle
|
||||
return dataSource
|
||||
}
|
||||
|
||||
func configure(_ cell: MainTimelineTableViewCell, article: Article) {
|
||||
|
||||
@discardableResult
|
||||
func configure(article: Article) -> MainTimelineCellData {
|
||||
let iconImage = iconImageFor(article)
|
||||
|
||||
let showFeedNames = coordinator?.showFeedNames ?? ShowFeedName.none
|
||||
let showIcon = showIcons && iconImage != nil
|
||||
cell.cellData = MainTimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.webFeed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcon, numberOfLines: numberOfTextLines, iconSize: iconSize)
|
||||
|
||||
let cellData = MainTimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.webFeed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcon, numberOfLines: numberOfTextLines, iconSize: iconSize)
|
||||
return cellData
|
||||
}
|
||||
|
||||
func iconImageFor(_ article: Article) -> IconImage? {
|
||||
|
||||
Reference in new issue
Block a user