diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index 6009f6ff1..9ae9c52b7 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -229,6 +229,11 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable { } + override func contentScrollView(for edge: NSDirectionalRectEdge) -> UIScrollView? { + return currentWebViewController?.webView?.scrollView + } + + // MARK: Notifications @objc dynamic func unreadCountDidChange(_ notification: Notification) { diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 38b83c1b2..d5c04f8d8 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -31,7 +31,7 @@ class WebViewController: UIViewController { private var topShowBarsViewConstraint: NSLayoutConstraint! private var bottomShowBarsViewConstraint: NSLayoutConstraint! - private var webView: PreloadedWebView? { + var webView: PreloadedWebView? { return view.subviews[0] as? PreloadedWebView } diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 4e39e3769..21e00f0a0 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -172,7 +172,7 @@ - + diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 87906f33e..ae0a14d4b 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -92,9 +92,13 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner refreshControl = UIRefreshControl() refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged) + + configureToolbar() + refreshProgressView = Bundle.main.loadNibNamed("RefreshProgressView", owner: self, options: nil)?[0] as? RefreshProgressView refreshProgressItemButton = UIBarButtonItem(customView: refreshProgressView!) + resetUI(resetScroll: true) // Load the table and then scroll to the saved position if available @@ -610,6 +614,23 @@ extension MasterTimelineViewController: UISearchBarDelegate { private extension MasterTimelineViewController { + + func configureToolbar() { + guard splitViewController?.isCollapsed ?? true else { + return + } + + guard let refreshProgressView = Bundle.main.loadNibNamed("RefreshProgressView", owner: self, options: nil)?[0] as? RefreshProgressView else { + return + } + + self.refreshProgressView = refreshProgressView + let refreshProgressItemButton = UIBarButtonItem(customView: refreshProgressView) + toolbarItems?.insert(refreshProgressItemButton, at: 2) + } + + + func resetUI(resetScroll: Bool) { title = coordinator.timelineFeed?.nameForDisplay ?? "Timeline" diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index af1010553..73d9c58b6 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -1364,14 +1364,20 @@ extension SceneCoordinator: UINavigationControllerDelegate { private extension SceneCoordinator { func configureNavigationController(_ navController: UINavigationController) { - let navigationStandardAppearance = UINavigationBarAppearance() - navigationStandardAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] - navigationStandardAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] - navController.navigationBar.standardAppearance = navigationStandardAppearance - let scrollEdgeStandardAppearance = UINavigationBarAppearance() - scrollEdgeStandardAppearance.backgroundColor = .systemBackground - navController.navigationBar.scrollEdgeAppearance = scrollEdgeStandardAppearance + let scrollEdge = UINavigationBarAppearance() + scrollEdge.configureWithOpaqueBackground() + scrollEdge.shadowColor = nil + scrollEdge.shadowImage = UIImage() + + let standard = UINavigationBarAppearance() + standard.shadowColor = .opaqueSeparator + standard.shadowImage = UIImage() + + navController.navigationBar.standardAppearance = standard + navController.navigationBar.compactAppearance = standard + navController.navigationBar.scrollEdgeAppearance = scrollEdge + navController.navigationBar.compactScrollEdgeAppearance = scrollEdge navController.navigationBar.tintColor = AppAssets.primaryAccentColor