From 5a6e0fd387ac02e53541b63551fa6c3f96c8e7db Mon Sep 17 00:00:00 2001 From: Martin Hartl Date: Sun, 19 Jan 2020 08:52:13 +0100 Subject: [PATCH 1/4] Apply UINavigationBarAppearance appearance to scroll edge --- iOS/UIKit Extensions/InteractiveNavigationController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/iOS/UIKit Extensions/InteractiveNavigationController.swift b/iOS/UIKit Extensions/InteractiveNavigationController.swift index e486a739a..855b3e82d 100644 --- a/iOS/UIKit Extensions/InteractiveNavigationController.swift +++ b/iOS/UIKit Extensions/InteractiveNavigationController.swift @@ -51,6 +51,7 @@ private extension InteractiveNavigationController { navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] navigationBar.standardAppearance = navigationAppearance + navigationBar.scrollEdgeAppearance = navigationAppearance navigationBar.tintColor = AppAssets.primaryAccentColor let toolbarAppearance = UIToolbarAppearance() From 88f565e03f54b3acc08fd3c230cdca6938497fc8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 19 Jan 2020 11:48:26 -0700 Subject: [PATCH 2/4] Use the DOM Y position to restore the scroll offset. This mostly fixes Issue #1494. --- iOS/Article/WebViewController.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index eee317fa2..16415a8dc 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -180,9 +180,9 @@ class WebViewController: UIViewController { } func fullReload() { - if let offset = webView?.scrollView.contentOffset.y { - restoreOffset = Int(offset) - webView?.reload() + webView?.evaluateJavaScript("window.scrollY") { (scrollY, _) in + self.restoreOffset = scrollY as! Int + self.reloadHTML() } } @@ -436,7 +436,9 @@ private extension WebViewController { // play on the iPad where we aren't constantly pushing and popping this controller. if (renderingTracker > 10) { reloadHTML() + return } + renderingTracker += 1 let style = ArticleStylesManager.shared.currentStyle From 09c8ca989810d2fe0020de1b534c0836e4f3b2df Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 19 Jan 2020 12:16:59 -0700 Subject: [PATCH 3/4] Remove unnecessary cell reload that was causing crashes. Issue #1535 --- iOS/MasterFeed/MasterFeedViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index e6f13fe29..afcb86e9a 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -1167,7 +1167,7 @@ private extension MasterFeedViewController { feed.rename(to: name) { result in switch result { case .success: - self?.reloadNode(node) + break case .failure(let error): self?.presentError(error) } @@ -1176,7 +1176,7 @@ private extension MasterFeedViewController { folder.rename(to: name) { result in switch result { case .success: - self?.reloadNode(node) + break case .failure(let error): self?.presentError(error) } From b1653845c206d0be570e9e4651f65bc584352143 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 19 Jan 2020 13:23:45 -0700 Subject: [PATCH 4/4] Remove media selector from block quotes so that the new style is always used. --- iOS/Resources/styleSheet.css | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/iOS/Resources/styleSheet.css b/iOS/Resources/styleSheet.css index d777f19c5..34eaa84cf 100644 --- a/iOS/Resources/styleSheet.css +++ b/iOS/Resources/styleSheet.css @@ -199,13 +199,11 @@ sub { width: 100% !important; } -@media (max-width: 420px) { - blockquote { - margin-inline-start: 0; - margin-inline-end: 0; - padding-left: 15px; - border-left: 3px solid var(--secondary-accent-color); - } +blockquote { + margin-inline-start: 0; + margin-inline-end: 0; + padding-left: 15px; + border-left: 3px solid var(--secondary-accent-color); } /* Feed Specific */