Merge pull request #4494 from stuartbreckenridge/main
🩹 Fixes incorrect refresh control visibility
This commit is contained in:
commit
314d80b73d
@ -59,7 +59,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||
|
||||
|
||||
// Initialize Programmatic Buttons
|
||||
filterButton = UIBarButtonItem(image: AppAssets.filterInactiveImage, style: .plain, target: self, action: #selector(toggleFilter(_:)))
|
||||
firstUnreadButton = UIBarButtonItem(image: AppAssets.nextUnreadArticleImage, style: .plain, target: self, action: #selector(firstUnread(_:)))
|
||||
@ -602,7 +602,7 @@ extension TimelineViewController: UISearchBarDelegate {
|
||||
|
||||
private extension TimelineViewController {
|
||||
|
||||
func configureToolbar() {
|
||||
func configureToolbar() {
|
||||
guard !(splitViewController?.isCollapsed ?? true) else {
|
||||
return
|
||||
}
|
||||
|
@ -1310,6 +1310,35 @@ extension SceneCoordinator: UISplitViewControllerDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
func splitViewController(_ svc: UISplitViewController, willChangeTo displayMode: UISplitViewController.DisplayMode) {
|
||||
switch displayMode {
|
||||
case .automatic:
|
||||
return
|
||||
case .secondaryOnly:
|
||||
return
|
||||
case .oneBesideSecondary:
|
||||
// Timeline + Article - show the refresh control on the timeline
|
||||
mainTimelineViewController?.toolbarItems?[2].customView?.alpha = 1.0
|
||||
case .oneOverSecondary:
|
||||
return
|
||||
case .twoBesideSecondary:
|
||||
return
|
||||
case .twoOverSecondary:
|
||||
return
|
||||
case .twoDisplaceSecondary:
|
||||
// Sidebar + Timeline + Article - hide the refresh control on the timeline
|
||||
mainTimelineViewController?.toolbarItems?[2].customView?.alpha = 0.0
|
||||
case .primaryHidden:
|
||||
return
|
||||
case .allVisible:
|
||||
return
|
||||
case .primaryOverlay:
|
||||
return
|
||||
@unknown default:
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: UINavigationControllerDelegate
|
||||
|
Loading…
x
Reference in New Issue
Block a user