Disables reader view in iOS for Feed Providers

This commit is contained in:
Stuart Breckenridge 2021-04-10 09:03:08 +08:00
parent 4e517a6db4
commit 0a433b8573
No known key found for this signature in database
GPG Key ID: ED2F112EEA9EF8A5
2 changed files with 14 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class ArticleViewController: UIViewController {
articleExtractorButton.addTarget(self, action: #selector(toggleArticleExtractor(_:)), for: .touchUpInside) articleExtractorButton.addTarget(self, action: #selector(toggleArticleExtractor(_:)), for: .touchUpInside)
toolbarItems?.insert(UIBarButtonItem(customView: articleExtractorButton), at: 6) toolbarItems?.insert(UIBarButtonItem(customView: articleExtractorButton), at: 6)
pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:]) pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:])
pageViewController.delegate = self pageViewController.delegate = self
pageViewController.dataSource = self pageViewController.dataSource = self
@ -179,7 +179,11 @@ class ArticleViewController: UIViewController {
starBarButtonItem.isEnabled = true starBarButtonItem.isEnabled = true
let permalinkPresent = article.preferredLink != nil let permalinkPresent = article.preferredLink != nil
articleExtractorButton.isEnabled = permalinkPresent && !AppDefaults.shared.isDeveloperBuild var isFeedProvider = false
if let webfeed = article.webFeed {
isFeedProvider = webfeed.isFeedProvider
}
articleExtractorButton.isEnabled = permalinkPresent && !AppDefaults.shared.isDeveloperBuild && !isFeedProvider
actionBarButtonItem.isEnabled = permalinkPresent actionBarButtonItem.isEnabled = permalinkPresent
if article.status.read { if article.status.read {

View File

@ -48,7 +48,14 @@ class WebFeedInspectorViewController: UITableViewController {
nameTextField.text = webFeed.nameForDisplay nameTextField.text = webFeed.nameForDisplay
notifyAboutNewArticlesSwitch.setOn(webFeed.isNotifyAboutNewArticles ?? false, animated: false) notifyAboutNewArticlesSwitch.setOn(webFeed.isNotifyAboutNewArticles ?? false, animated: false)
alwaysShowReaderViewSwitch.setOn(webFeed.isArticleExtractorAlwaysOn ?? false, animated: false)
if webFeed.isFeedProvider {
alwaysShowReaderViewSwitch.isOn = false
alwaysShowReaderViewSwitch.isEnabled = false
} else {
alwaysShowReaderViewSwitch.setOn(webFeed.isArticleExtractorAlwaysOn ?? false, animated: false)
}
homePageLabel.text = webFeed.homePageURL?.decodedURLString homePageLabel.text = webFeed.homePageURL?.decodedURLString
feedURLLabel.text = webFeed.url.decodedURLString feedURLLabel.text = webFeed.url.decodedURLString