diff --git a/BraveShared/BraveStrings.swift b/BraveShared/BraveStrings.swift index 81deee0c31e..d36f9b2f623 100644 --- a/BraveShared/BraveStrings.swift +++ b/BraveShared/BraveStrings.swift @@ -1995,11 +1995,11 @@ extension Strings { } extension Strings { - public struct BraveToday { - public static let braveToday = NSLocalizedString( + public struct BraveNews { + public static let braveNews = NSLocalizedString( "today.braveToday", bundle: .braveShared, - value: "Brave Today", + value: "Brave News", comment: "The name of the feature" ) public static let sourcesAndSettings = NSLocalizedString( @@ -2008,10 +2008,10 @@ extension Strings { value: "Sources & Settings", comment: "" ) - public static let turnOnBraveToday = NSLocalizedString( + public static let turnOnBraveNews = NSLocalizedString( "today.turnOnBraveToday", bundle: .braveShared, - value: "Turn on Brave Today", + value: "Turn on Brave News", comment: "" ) public static let learnMoreTitle = NSLocalizedString( @@ -2029,7 +2029,7 @@ extension Strings { public static let introCardBody = NSLocalizedString( "today.introCardBody", bundle: .braveShared, - value: "Brave Today is ad-supported with completely private and anonymized ads matched on your device.", + value: "Brave News is ad-supported with completely private and anonymized ads matched on your device.", comment: "" ) public static let introCardNew = NSLocalizedString( @@ -2041,7 +2041,7 @@ extension Strings { public static let introCardNewTextBody = NSLocalizedString( "today.introCardNewTextBody", bundle: .braveShared, - value: "Customize Brave Today with up to 5 RSS feeds and get new content from your favorite publishers throughout the day.", + value: "Customize your feed using hundreds of leading content sources delivered through our private CDN, and add RSS feeds from your favorite publishers to make a feed that works just for you.", comment: "" ) public static let refresh = NSLocalizedString( @@ -2107,7 +2107,7 @@ extension Strings { public static let errorGeneralBody = NSLocalizedString( "today.errorGeneralBody", bundle: .braveShared, - value: "Brave Today is experiencing some issues. Try again.", + value: "Brave News is experiencing some issues. Try again.", comment: "" ) public static let disablePublisherContent = NSLocalizedString( @@ -2131,13 +2131,13 @@ extension Strings { public static let disabledAlertBody = NSLocalizedString( "today.disabledAlertBody", bundle: .braveShared, - value: "Brave Today will stop showing content from %@", + value: "Brave News will stop showing content from %@", comment: "'%@' will turn into the name of a publisher (verbatim), for example: Brave Blog" ) public static let isEnabledToggleLabel = NSLocalizedString( "today.isEnabledToggleLabel", bundle: .braveShared, - value: "Show Brave Today", + value: "Show Brave News", comment: "" ) public static let settingsSourceHeaderTitle = NSLocalizedString( @@ -2179,7 +2179,7 @@ extension Strings { public static let addSourceShareTitle = NSLocalizedString( "today.addSourceShareTitle", bundle: .braveShared, - value: "Add Source to Brave Today", + value: "Add Source to Brave News", comment: "The action title displayed in the iOS share menu" ) public static let addSourceFailureTitle = NSLocalizedString( @@ -2212,24 +2212,6 @@ extension Strings { value: "Add", comment: "To add a list of 1 or more rss feeds" ) - public static let rssFeedLimitExceededAlertTitle = NSLocalizedString( - "today.rssFeedLimitExceededAlertTitle", - bundle: .braveShared, - value: "Feed limit exceeded", - comment: "" - ) - public static let rssFeedLimitExceededAlertMessage = NSLocalizedString( - "today.rssFeedLimitExceededAlertMessage", - bundle: .braveShared, - value: "The free ad-supported version of Brave Today includes 5 RSS feeds. You can customize your feed selections from the Sources list.", - comment: "" - ) - public static let rssFeedLimitRemainingFooter = NSLocalizedString( - "today.rssFeedLimitRemainingFooter", - bundle: .braveShared, - value: "You currently have %d RSS feeds in your Sources list. The free ad-supported version of Brave Today includes 5 RSS feeds. Support for unlimited feeds and OPML import will be coming soon. You can customize your feed selections from the Sources list.", - comment: "%d will be a number (i.e. 4)" - ) public static let insecureSourcesHeader = NSLocalizedString( "today.insecureSourcesHeader", bundle: .braveShared, diff --git a/BraveShared/BraveUX.swift b/BraveShared/BraveUX.swift index 17155e8e872..90c70c1fe3e 100644 --- a/BraveShared/BraveUX.swift +++ b/BraveShared/BraveUX.swift @@ -4,11 +4,11 @@ public struct BraveUX { public static let braveCommunityURL = URL(string: "https://community.brave.com/")! public static let braveVPNFaqURL = URL(string: "https://support.brave.com/hc/en-us/articles/360045045952")! public static let bravePrivacyURL = URL(string: "https://brave.com/privacy/")! - public static let braveTodayPrivacyURL = URL(string: "https://brave.com/privacy/#brave-today")! + public static let braveNewsPrivacyURL = URL(string: "https://brave.com/privacy/#brave-news")! public static let braveOffersURL = URL(string: "https://offers.brave.com/")! public static let braveRewardsLearnMoreURL = URL(string: "https://brave.com/rewards-ios/")! public static let braveRewardsUnverifiedPublisherLearnMoreURL = URL(string: "https://brave.com/faq-rewards/#unclaimed-funds")! - public static let braveTodayPartnersURL = URL(string: "https://brave.com/brave-today/")! + public static let braveNewsPartnersURL = URL(string: "https://brave.com/brave-news/")! public static let braveTermsOfUseURL = URL(string: "https://www.brave.com/terms_of_use")! public static let ntpTutorialPageURL = URL(string: "https://brave.com/ja/ntp-tutorial") diff --git a/BraveShared/Preferences.swift b/BraveShared/Preferences.swift index ca81c50d7a2..8f6b19a4c50 100644 --- a/BraveShared/Preferences.swift +++ b/BraveShared/Preferences.swift @@ -51,7 +51,7 @@ extension Preferences { public static let ntpCheckDate = Option(key: "ntp.next-check-date", default: nil) } - public final class BraveToday { + public final class BraveNews { public static let isShowingOptIn = Option(key: "brave-today.showing-opt-in", default: false) public static let userOptedIn = Option(key: "brave-today.user-opted-in", default: false) public static let isEnabled = Option(key: "brave-today.enabled", default: true) diff --git a/Client.xcodeproj/project.pbxproj b/Client.xcodeproj/project.pbxproj index e8e9de048bf..206c91fefe0 100644 --- a/Client.xcodeproj/project.pbxproj +++ b/Client.xcodeproj/project.pbxproj @@ -220,12 +220,12 @@ 27201EFE24539B5500C19DD1 /* NewTabPageBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27201EFD24539B5500C19DD1 /* NewTabPageBackground.swift */; }; 27201F022458879700C19DD1 /* NewTabPageBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27201F012458879700C19DD1 /* NewTabPageBackgroundView.swift */; }; 27201F0424589B9800C19DD1 /* NewTabPageNotifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27201F0324589B9800C19DD1 /* NewTabPageNotifications.swift */; }; - 2726636924944BFA0056CFE1 /* BraveTodayOptInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2726636824944BFA0056CFE1 /* BraveTodayOptInView.swift */; }; + 2726636924944BFA0056CFE1 /* BraveNewsOptInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2726636824944BFA0056CFE1 /* BraveNewsOptInView.swift */; }; 2726637324981B600056CFE1 /* FeedSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2726637224981B5F0056CFE1 /* FeedSectionHeaderView.swift */; }; 2727369B24A65F650096DCB9 /* UIActionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2727369A24A65F650096DCB9 /* UIActionExtensions.swift */; }; 27384CAE254360120086922F /* OnboardingRewardsAgreementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E1D8C6C232BF9C200BDE662 /* OnboardingRewardsAgreementView.swift */; }; 273EB3A72422AB24002A8AAF /* PaymentRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9616E6A240EE43F00667C2D /* PaymentRequest.swift */; }; - 273FCB9A25A7BC5500F279B5 /* BraveTodayDebugSettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273FCB9925A7BC5500F279B5 /* BraveTodayDebugSettingsController.swift */; }; + 273FCB9A25A7BC5500F279B5 /* BraveNewsDebugSettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273FCB9925A7BC5500F279B5 /* BraveNewsDebugSettingsController.swift */; }; 274398E224E4827800E79605 /* FeedCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274398E124E4827800E79605 /* FeedCard.swift */; }; 274398E524E4829900E79605 /* FeedFillStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274398E424E4829900E79605 /* FeedFillStrategy.swift */; }; 274398E724E483AD00E79605 /* FeedItemMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274398E624E483AD00E79605 /* FeedItemMenu.swift */; }; @@ -255,7 +255,7 @@ 2755EAD3255329540033C43F /* BraveLedgerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2755EAD2255329540033C43F /* BraveLedgerExtensions.swift */; }; 27563E63263334210082B413 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27563E62263334210082B413 /* Colors.xcassets */; }; 275965E224EEC4EA0051A827 /* FeedFillStrategyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 275965E124EEC4EA0051A827 /* FeedFillStrategyTests.swift */; }; - 2760056625D1FFF500D47A75 /* AddFeedToBraveTodayActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2760056525D1FFF500D47A75 /* AddFeedToBraveTodayActivity.swift */; }; + 2760056625D1FFF500D47A75 /* AddFeedToBraveNewsActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2760056525D1FFF500D47A75 /* AddFeedToBraveNewsActivity.swift */; }; 2760D2BF215ACCE20068E131 /* BundleExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2760D2BE215ACCE20068E131 /* BundleExtensions.swift */; }; 2765825D2171263A00754B2F /* UserReferralProgram.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2765825C2171263A00754B2F /* UserReferralProgram.swift */; }; 276582692171266900754B2F /* ReferralData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 276582652171266900754B2F /* ReferralData.swift */; }; @@ -312,7 +312,7 @@ 27829E412548B8A0007CF0B2 /* BraveRewardsSupportedCountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27829E402548B8A0007CF0B2 /* BraveRewardsSupportedCountView.swift */; }; 27829E752549FF13007CF0B2 /* WalletTransferViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27829E742549FF13007CF0B2 /* WalletTransferViewController.swift */; }; 27829E842549FF9D007CF0B2 /* WalletTransferView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27829E832549FF9D007CF0B2 /* WalletTransferView.swift */; }; - 2784874524DC658C0004F03C /* BraveTodayEmptyFeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2784874424DC658C0004F03C /* BraveTodayEmptyFeedView.swift */; }; + 2784874524DC658C0004F03C /* BraveNewsEmptyFeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2784874424DC658C0004F03C /* BraveNewsEmptyFeedView.swift */; }; 278655A225C227C8009FFE80 /* AdblockRust.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27F47A3125AFCECE004922E4 /* AdblockRust.xcframework */; }; 278655A325C227C8009FFE80 /* AdblockRust.xcframework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 27F47A3125AFCECE004922E4 /* AdblockRust.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 278655B925C227E1009FFE80 /* OnePasswordExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 277569F425ACFD3F00C129AF /* OnePasswordExtension.framework */; }; @@ -349,7 +349,7 @@ 279CC2B0260CEB5D009B3895 /* ActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279CC2AF260CEB5D009B3895 /* ActivityIndicatorView.swift */; }; 279CC2C4260CEFE7009B3895 /* TableCellButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279CC2C3260CEFE7009B3895 /* TableCellButtonStyle.swift */; }; 279CC2D8260CF37C009B3895 /* BrowserViewController+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279CC2D7260CF37C009B3895 /* BrowserViewController+Menu.swift */; }; - 27A1ABF42485567900344503 /* BraveTodaySectionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A1ABF32485567900344503 /* BraveTodaySectionProvider.swift */; }; + 27A1ABF42485567900344503 /* BraveNewsSectionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A1ABF32485567900344503 /* BraveNewsSectionProvider.swift */; }; 27A1ABF62485568700344503 /* FlexibleSpaceSectionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A1ABF52485568700344503 /* FlexibleSpaceSectionProvider.swift */; }; 27A1ABFF24855C1700344503 /* FeedGroupViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A1ABFA24855C1700344503 /* FeedGroupViews.swift */; }; 27A1AC0024855C1700344503 /* FeedCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A1ABFB24855C1700344503 /* FeedCardCell.swift */; }; @@ -372,7 +372,7 @@ 27B68DF025C48F39002D0826 /* MaterialComponents.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B68DD625C48EE9002D0826 /* MaterialComponents.xcframework */; }; 27B68DF125C48F39002D0826 /* MaterialComponents.xcframework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 27B68DD625C48EE9002D0826 /* MaterialComponents.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 27B68E5D25C88CA7002D0826 /* FeedKit in Frameworks */ = {isa = PBXBuildFile; productRef = 27B68E5C25C88CA7002D0826 /* FeedKit */; }; - 27B68E9425C8911D002D0826 /* BraveTodayAddSourceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B68E9325C8911D002D0826 /* BraveTodayAddSourceViewController.swift */; }; + 27B68E9425C8911D002D0826 /* BraveNewsAddSourceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B68E9325C8911D002D0826 /* BraveNewsAddSourceViewController.swift */; }; 27C405E3242559AE00347246 /* Shared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288A2D861AB8B3260023ABC3 /* Shared.framework */; }; 27C405E924255A2B00347246 /* BraveShared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DE7688420B3456C00FF5533 /* BraveShared.framework */; }; 27C461DE211B76500088A441 /* ShieldsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C461DD211B76500088A441 /* ShieldsView.swift */; }; @@ -389,11 +389,11 @@ 27CFB71424E1F67B008DFC8C /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27CFB71324E1F67B008DFC8C /* Observable.swift */; }; 27D114D42358FBBF00166534 /* BraveRewardsSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27D114D32358FBBF00166534 /* BraveRewardsSettingsViewController.swift */; }; 27D114D62358FCA400166534 /* SettingsRowViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27D114D52358FCA400166534 /* SettingsRowViews.swift */; }; - 27D67CED24D07EB800066D83 /* BraveTodaySettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27D67CEC24D07EB800066D83 /* BraveTodaySettingsViewController.swift */; }; + 27D67CED24D07EB800066D83 /* BraveNewsSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27D67CEC24D07EB800066D83 /* BraveNewsSettingsViewController.swift */; }; 27DCB9EC263764EF0067EF4A /* TabTrayCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27DCB9EB263764EF0067EF4A /* TabTrayCell.swift */; }; 27DCB9EE263765430067EF4A /* TabTrayToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27DCB9ED263765430067EF4A /* TabTrayToolbar.swift */; }; 27E0652624CB69C700134946 /* brave-today-welcome-graphic.json in Resources */ = {isa = PBXBuildFile; fileRef = 27E0652524CB69C700134946 /* brave-today-welcome-graphic.json */; }; - 27E0652824CB6AE300134946 /* BraveTodayErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E0652724CB6AE300134946 /* BraveTodayErrorView.swift */; }; + 27E0652824CB6AE300134946 /* BraveNewsErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E0652724CB6AE300134946 /* BraveNewsErrorView.swift */; }; 27EA04C2249D4336004F5D2E /* FeedCardContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27EA04C1249D4336004F5D2E /* FeedCardContent.swift */; }; 27EB6020244607DA00265C1B /* NewTabPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27EB601F244607DA00265C1B /* NewTabPageViewController.swift */; }; 27EF6B8024BF48C7005E034F /* FeedSourceListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27EF6B7F24BF48C7005E034F /* FeedSourceListViewController.swift */; }; @@ -408,7 +408,7 @@ 27FD2CAB2146C31C00A5A779 /* RequestDesktopSiteActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD2CA12146C31C00A5A779 /* RequestDesktopSiteActivity.swift */; }; 27FD2CAC2146C31C00A5A779 /* FindInPageActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD2CA92146C31C00A5A779 /* FindInPageActivity.swift */; }; 27FD2CAD2146C31C00A5A779 /* AddToFavoritesActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD2CAA2146C31C00A5A779 /* AddToFavoritesActivity.swift */; }; - 27FD3F7825C8B0E700696156 /* BraveTodayAddSourceResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD3F7725C8B0E700696156 /* BraveTodayAddSourceResultsViewController.swift */; }; + 27FD3F7825C8B0E700696156 /* BraveNewsAddSourceResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD3F7725C8B0E700696156 /* BraveNewsAddSourceResultsViewController.swift */; }; 27FD3FA625C8CE4B00696156 /* RSSFeedSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD3FA525C8CE4B00696156 /* RSSFeedSource.swift */; }; 27FD3FBA25C8D20200696156 /* FeedDataSource+RSS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD3FB925C8D20200696156 /* FeedDataSource+RSS.swift */; }; 2816F0001B33E05400522243 /* UIConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2816EFFF1B33E05400522243 /* UIConstants.swift */; }; @@ -1593,10 +1593,10 @@ 27201EFD24539B5500C19DD1 /* NewTabPageBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageBackground.swift; sourceTree = ""; }; 27201F012458879700C19DD1 /* NewTabPageBackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageBackgroundView.swift; sourceTree = ""; }; 27201F0324589B9800C19DD1 /* NewTabPageNotifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageNotifications.swift; sourceTree = ""; }; - 2726636824944BFA0056CFE1 /* BraveTodayOptInView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodayOptInView.swift; sourceTree = ""; }; + 2726636824944BFA0056CFE1 /* BraveNewsOptInView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsOptInView.swift; sourceTree = ""; }; 2726637224981B5F0056CFE1 /* FeedSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedSectionHeaderView.swift; sourceTree = ""; }; 2727369A24A65F650096DCB9 /* UIActionExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIActionExtensions.swift; sourceTree = ""; }; - 273FCB9925A7BC5500F279B5 /* BraveTodayDebugSettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodayDebugSettingsController.swift; sourceTree = ""; }; + 273FCB9925A7BC5500F279B5 /* BraveNewsDebugSettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsDebugSettingsController.swift; sourceTree = ""; }; 274398E124E4827800E79605 /* FeedCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedCard.swift; sourceTree = ""; }; 274398E424E4829900E79605 /* FeedFillStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedFillStrategy.swift; sourceTree = ""; }; 274398E624E483AD00E79605 /* FeedItemMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedItemMenu.swift; sourceTree = ""; }; @@ -1623,7 +1623,7 @@ 2755EAD2255329540033C43F /* BraveLedgerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveLedgerExtensions.swift; sourceTree = ""; }; 27563E62263334210082B413 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; 275965E124EEC4EA0051A827 /* FeedFillStrategyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedFillStrategyTests.swift; sourceTree = ""; }; - 2760056525D1FFF500D47A75 /* AddFeedToBraveTodayActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedToBraveTodayActivity.swift; sourceTree = ""; }; + 2760056525D1FFF500D47A75 /* AddFeedToBraveNewsActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedToBraveNewsActivity.swift; sourceTree = ""; }; 2760D2BE215ACCE20068E131 /* BundleExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleExtensions.swift; sourceTree = ""; }; 2765825C2171263A00754B2F /* UserReferralProgram.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserReferralProgram.swift; sourceTree = ""; }; 276582652171266900754B2F /* ReferralData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReferralData.swift; sourceTree = ""; }; @@ -1784,7 +1784,7 @@ 27829E402548B8A0007CF0B2 /* BraveRewardsSupportedCountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveRewardsSupportedCountView.swift; sourceTree = ""; }; 27829E742549FF13007CF0B2 /* WalletTransferViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletTransferViewController.swift; sourceTree = ""; }; 27829E832549FF9D007CF0B2 /* WalletTransferView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletTransferView.swift; sourceTree = ""; }; - 2784874424DC658C0004F03C /* BraveTodayEmptyFeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodayEmptyFeedView.swift; sourceTree = ""; }; + 2784874424DC658C0004F03C /* BraveNewsEmptyFeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsEmptyFeedView.swift; sourceTree = ""; }; 278C467723EDF0060083347F /* SimpleShieldsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleShieldsView.swift; sourceTree = ""; }; 278C467A23EDF0940083347F /* ShieldsSwitch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShieldsSwitch.swift; sourceTree = ""; }; 278C468623F1E6270083347F /* BraveUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BraveUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1806,7 +1806,7 @@ 279CC2AF260CEB5D009B3895 /* ActivityIndicatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityIndicatorView.swift; sourceTree = ""; }; 279CC2C3260CEFE7009B3895 /* TableCellButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableCellButtonStyle.swift; sourceTree = ""; }; 279CC2D7260CF37C009B3895 /* BrowserViewController+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BrowserViewController+Menu.swift"; sourceTree = ""; }; - 27A1ABF32485567900344503 /* BraveTodaySectionProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodaySectionProvider.swift; sourceTree = ""; }; + 27A1ABF32485567900344503 /* BraveNewsSectionProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsSectionProvider.swift; sourceTree = ""; }; 27A1ABF52485568700344503 /* FlexibleSpaceSectionProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexibleSpaceSectionProvider.swift; sourceTree = ""; }; 27A1ABFA24855C1700344503 /* FeedGroupViews.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedGroupViews.swift; sourceTree = ""; }; 27A1ABFB24855C1700344503 /* FeedCardCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedCardCell.swift; sourceTree = ""; }; @@ -1828,7 +1828,7 @@ 27B68DD625C48EE9002D0826 /* MaterialComponents.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MaterialComponents.xcframework; path = "node_modules/brave-core-ios/MaterialComponents.xcframework"; sourceTree = ""; }; 27B68DD725C48EE9002D0826 /* BraveRewards.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BraveRewards.xcframework; path = "node_modules/brave-core-ios/BraveRewards.xcframework"; sourceTree = ""; }; 27B68E8725C88F28002D0826 /* Model11.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model11.xcdatamodel; sourceTree = ""; }; - 27B68E9325C8911D002D0826 /* BraveTodayAddSourceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodayAddSourceViewController.swift; sourceTree = ""; }; + 27B68E9325C8911D002D0826 /* BraveNewsAddSourceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsAddSourceViewController.swift; sourceTree = ""; }; 27C461DD211B76500088A441 /* ShieldsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShieldsView.swift; sourceTree = ""; }; 27C5AC8625D6FA6D00B8F50E /* OPML.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPML.swift; sourceTree = ""; }; 27C5AE2D25D72B0A00B8F50E /* OPMLParsingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPMLParsingTests.swift; sourceTree = ""; }; @@ -1842,12 +1842,12 @@ 27CFB71324E1F67B008DFC8C /* Observable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Observable.swift; sourceTree = ""; }; 27D114D32358FBBF00166534 /* BraveRewardsSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveRewardsSettingsViewController.swift; sourceTree = ""; }; 27D114D52358FCA400166534 /* SettingsRowViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsRowViews.swift; sourceTree = ""; }; - 27D67CEC24D07EB800066D83 /* BraveTodaySettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodaySettingsViewController.swift; sourceTree = ""; }; + 27D67CEC24D07EB800066D83 /* BraveNewsSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsSettingsViewController.swift; sourceTree = ""; }; 27D922B221C9830F00345BF3 /* Model9.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model9.xcdatamodel; sourceTree = ""; }; 27DCB9EB263764EF0067EF4A /* TabTrayCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabTrayCell.swift; sourceTree = ""; }; 27DCB9ED263765430067EF4A /* TabTrayToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabTrayToolbar.swift; sourceTree = ""; }; 27E0652524CB69C700134946 /* brave-today-welcome-graphic.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "brave-today-welcome-graphic.json"; sourceTree = ""; }; - 27E0652724CB6AE300134946 /* BraveTodayErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodayErrorView.swift; sourceTree = ""; }; + 27E0652724CB6AE300134946 /* BraveNewsErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsErrorView.swift; sourceTree = ""; }; 27EA04C1249D4336004F5D2E /* FeedCardContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedCardContent.swift; sourceTree = ""; }; 27EB601F244607DA00265C1B /* NewTabPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTabPageViewController.swift; sourceTree = ""; }; 27EEEDB52507CE1C00024038 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; @@ -1864,7 +1864,7 @@ 27FD2CA12146C31C00A5A779 /* RequestDesktopSiteActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestDesktopSiteActivity.swift; sourceTree = ""; }; 27FD2CA92146C31C00A5A779 /* FindInPageActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindInPageActivity.swift; sourceTree = ""; }; 27FD2CAA2146C31C00A5A779 /* AddToFavoritesActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddToFavoritesActivity.swift; sourceTree = ""; }; - 27FD3F7725C8B0E700696156 /* BraveTodayAddSourceResultsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveTodayAddSourceResultsViewController.swift; sourceTree = ""; }; + 27FD3F7725C8B0E700696156 /* BraveNewsAddSourceResultsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BraveNewsAddSourceResultsViewController.swift; sourceTree = ""; }; 27FD3FA525C8CE4B00696156 /* RSSFeedSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSSFeedSource.swift; sourceTree = ""; }; 27FD3FB925C8D20200696156 /* FeedDataSource+RSS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FeedDataSource+RSS.swift"; sourceTree = ""; }; 2816EFFF1B33E05400522243 /* UIConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIConstants.swift; sourceTree = ""; }; @@ -3298,7 +3298,7 @@ 27FCA8E2244770AB00A8CA48 /* FavoritesOverflowSectionProvider.swift */, 27FCA8E62447BCFE00A8CA48 /* DuckDuckGoCalloutSectionProvider.swift */, 27A1ABF52485568700344503 /* FlexibleSpaceSectionProvider.swift */, - 27A1ABF32485567900344503 /* BraveTodaySectionProvider.swift */, + 27A1ABF32485567900344503 /* BraveNewsSectionProvider.swift */, ); path = Sections; sourceTree = ""; @@ -3744,9 +3744,9 @@ 27A1ABF924855C1700344503 /* Cards */ = { isa = PBXGroup; children = ( - 2726636824944BFA0056CFE1 /* BraveTodayOptInView.swift */, - 27E0652724CB6AE300134946 /* BraveTodayErrorView.swift */, - 2784874424DC658C0004F03C /* BraveTodayEmptyFeedView.swift */, + 2726636824944BFA0056CFE1 /* BraveNewsOptInView.swift */, + 27E0652724CB6AE300134946 /* BraveNewsErrorView.swift */, + 2784874424DC658C0004F03C /* BraveNewsEmptyFeedView.swift */, 27A1ABFC24855C1700344503 /* FeedCardBackgroundView.swift */, 27A1ABFA24855C1700344503 /* FeedGroupViews.swift */, 27A1AC0824859D0900344503 /* FeedHeadlineViews.swift */, @@ -3776,15 +3776,15 @@ path = Composer; sourceTree = ""; }; - 27B68E9225C8910D002D0826 /* Brave Today */ = { + 27B68E9225C8910D002D0826 /* Brave News */ = { isa = PBXGroup; children = ( - 27D67CEC24D07EB800066D83 /* BraveTodaySettingsViewController.swift */, - 273FCB9925A7BC5500F279B5 /* BraveTodayDebugSettingsController.swift */, - 27B68E9325C8911D002D0826 /* BraveTodayAddSourceViewController.swift */, - 27FD3F7725C8B0E700696156 /* BraveTodayAddSourceResultsViewController.swift */, + 27D67CEC24D07EB800066D83 /* BraveNewsSettingsViewController.swift */, + 273FCB9925A7BC5500F279B5 /* BraveNewsDebugSettingsController.swift */, + 27B68E9325C8911D002D0826 /* BraveNewsAddSourceViewController.swift */, + 27FD3F7725C8B0E700696156 /* BraveNewsAddSourceResultsViewController.swift */, ); - path = "Brave Today"; + path = "Brave News"; sourceTree = ""; }; 27C5AC7A25D6FA5400B8F50E /* OPML */ = { @@ -3931,7 +3931,7 @@ 2F44FC551A9E83E200FD20CC /* Settings */ = { isa = PBXGroup; children = ( - 27B68E9225C8910D002D0826 /* Brave Today */, + 27B68E9225C8910D002D0826 /* Brave News */, 2746D26C24A291ED00E38852 /* Rewards Internals */, 0B62EFD11AD63CD100ACB9CD /* Clearables.swift */, 2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */, @@ -4852,7 +4852,7 @@ D3972BF11C22412B00035B87 /* ShareExtensionHelper.swift */, D3972BF21C22412B00035B87 /* TitleActivityItemProvider.swift */, 2703BE8A24F4508E00CBE6CD /* CreatePDFActivity.swift */, - 2760056525D1FFF500D47A75 /* AddFeedToBraveTodayActivity.swift */, + 2760056525D1FFF500D47A75 /* AddFeedToBraveNewsActivity.swift */, 2F198EE72603FDD900945AB3 /* AddSearchEngineActivity.swift */, 2FDF290725DEE265001E5C87 /* AddToPlaylistActivity.swift */, ); @@ -6792,7 +6792,7 @@ 4422D56B21BFFB7F00BF1855 /* prefilter_tree.cc in Sources */, 4422D4FC21BFFB7600BF1855 /* version_set.cc in Sources */, 4422D4C821BFFB7600BF1855 /* env.cc in Sources */, - 27D67CED24D07EB800066D83 /* BraveTodaySettingsViewController.swift in Sources */, + 27D67CED24D07EB800066D83 /* BraveNewsSettingsViewController.swift in Sources */, 0A64384B24FD3F0F000E80A3 /* DomainUserScript.swift in Sources */, 4422D56321BFFB7F00BF1855 /* compile.cc in Sources */, D3C3696E1CC6B78800348A61 /* LocalRequestHelper.swift in Sources */, @@ -6915,7 +6915,7 @@ 0A1E84422190A57F0042F782 /* SyncPairCameraViewController.swift in Sources */, 27C647A62551F082006D72FC /* RewardsDebugSettingsViewController.swift in Sources */, 27829E752549FF13007CF0B2 /* WalletTransferViewController.swift in Sources */, - 2760056625D1FFF500D47A75 /* AddFeedToBraveTodayActivity.swift in Sources */, + 2760056625D1FFF500D47A75 /* AddFeedToBraveNewsActivity.swift in Sources */, 44331DDC22561F34007E3E93 /* ToolbarUrlActionsDelegate.swift in Sources */, 27C6478F2551CD2B006D72FC /* RewardsInternalsDebugViewController.swift in Sources */, 4422D43721BFD29E00BF1855 /* NSData+GZIP.m in Sources */, @@ -6925,8 +6925,8 @@ 0A764F31230EE5CA003A1D9B /* OnboardingState.swift in Sources */, D8D33A7D1FBD080300A20A28 /* SnapKitExtensions.swift in Sources */, 27AC7CFA24C77EBC00441317 /* FeedActionAlertView.swift in Sources */, - 27FD3F7825C8B0E700696156 /* BraveTodayAddSourceResultsViewController.swift in Sources */, - 27E0652824CB6AE300134946 /* BraveTodayErrorView.swift in Sources */, + 27FD3F7825C8B0E700696156 /* BraveNewsAddSourceResultsViewController.swift in Sources */, + 27E0652824CB6AE300134946 /* BraveNewsErrorView.swift in Sources */, E650755C1E37F747006961AC /* Swizzling.m in Sources */, 2FE63DB8258BCC29004B219D /* BrowserViewController+OpenSearch.swift in Sources */, 2719DA09249D37490080AB48 /* SponsorCardView.swift in Sources */, @@ -6979,7 +6979,7 @@ D0625CA8208FC47A0081F3B2 /* BrowserViewController+DownloadQueueDelegate.swift in Sources */, 2F44FCC71A9E8CF500FD20CC /* SearchSettingsTableViewController.swift in Sources */, 2FDF290825DEE265001E5C87 /* AddToPlaylistActivity.swift in Sources */, - 273FCB9A25A7BC5500F279B5 /* BraveTodayDebugSettingsController.swift in Sources */, + 273FCB9A25A7BC5500F279B5 /* BraveNewsDebugSettingsController.swift in Sources */, 39A359E41BFCCE94006B9E87 /* UserActivityHandler.swift in Sources */, 0AF6B1EA24A0EE19005417FC /* InstallVPNView.swift in Sources */, 27201F0424589B9800C19DD1 /* NewTabPageNotifications.swift in Sources */, @@ -7026,7 +7026,7 @@ E650754E1E37F6AE006961AC /* GeometryExtensions.swift in Sources */, D3972BF41C22412B00035B87 /* TitleActivityItemProvider.swift in Sources */, 4422D4EE21BFFB7600BF1855 /* table_cache.cc in Sources */, - 2784874524DC658C0004F03C /* BraveTodayEmptyFeedView.swift in Sources */, + 2784874524DC658C0004F03C /* BraveNewsEmptyFeedView.swift in Sources */, 27829E092548AA8B007CF0B2 /* BraveRewardsView.swift in Sources */, D38A1BEE1A9FA2CA00F6A386 /* SiteTableViewController.swift in Sources */, E6D8D5E71B569D70009E5A58 /* BrowserTrayAnimators.swift in Sources */, @@ -7070,7 +7070,7 @@ 44331DD8225521B6007E3E93 /* UrlBarTextField.swift in Sources */, A9072B801D07B34100459960 /* NoImageModeHelper.swift in Sources */, 4422D4EB21BFFB7600BF1855 /* filename.cc in Sources */, - 2726636924944BFA0056CFE1 /* BraveTodayOptInView.swift in Sources */, + 2726636924944BFA0056CFE1 /* BraveNewsOptInView.swift in Sources */, CA439A5925E6F29D00FE9150 /* VideoPlayerInfoBar.swift in Sources */, 277E94F225F834240001926E /* VPNMenuButton.swift in Sources */, 2755EABD255323C60033C43F /* PublisherInfoExtensions.swift in Sources */, @@ -7113,7 +7113,7 @@ 0BD19A671A25309B0084FBA7 /* NSUserDefaultsPrefs.swift in Sources */, 27448522245A1A1C001920B5 /* FavoritesViewController.swift in Sources */, 4422D4F021BFFB7600BF1855 /* write_batch.cc in Sources */, - 27A1ABF42485567900344503 /* BraveTodaySectionProvider.swift in Sources */, + 27A1ABF42485567900344503 /* BraveNewsSectionProvider.swift in Sources */, E68AEDB01B18F81A00133D99 /* SwipeAnimator.swift in Sources */, 0AEFB8532226D7C5007AF600 /* AdblockResourcesMappings.swift in Sources */, 0A66550A23E9D9750047EF2A /* UserAgent.swift in Sources */, @@ -7178,7 +7178,7 @@ 0A1E84462190A57F0042F782 /* SyncAddDeviceViewController.swift in Sources */, 4422D42C21BFCF8900BF1855 /* HttpsEverywhere.cpp in Sources */, 4422D50021BFFB7600BF1855 /* db_iter.cc in Sources */, - 27B68E9425C8911D002D0826 /* BraveTodayAddSourceViewController.swift in Sources */, + 27B68E9425C8911D002D0826 /* BraveNewsAddSourceViewController.swift in Sources */, D0625C98208E87F10081F3B2 /* DownloadQueue.swift in Sources */, 4422D54621BFFB7E00BF1855 /* rune.cc in Sources */, 2F198EE82603FDD900945AB3 /* AddSearchEngineActivity.swift in Sources */, diff --git a/Client/Application/Delegates/AppDelegate.swift b/Client/Application/Delegates/AppDelegate.swift index 678ff57f37a..ffbf6a510aa 100644 --- a/Client/Application/Delegates/AppDelegate.swift +++ b/Client/Application/Delegates/AppDelegate.swift @@ -129,19 +129,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati class_addMethod(clazz, MenuHelper.selectorFindInPage, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)) } - #if !NO_BRAVE_TODAY - if Preferences.BraveToday.isEnabled.value && !Preferences.BraveToday.userOptedIn.value { + #if !NO_BRAVE_NEWS + if Preferences.BraveNews.isEnabled.value && !Preferences.BraveNews.userOptedIn.value { // Opt-out any user that has not explicitly opted-in - Preferences.BraveToday.isEnabled.value = false + Preferences.BraveNews.isEnabled.value = false // User now has to explicitly opt-in - Preferences.BraveToday.isShowingOptIn.value = true + Preferences.BraveNews.isShowingOptIn.value = true } - if !Preferences.BraveToday.languageChecked.value, + if !Preferences.BraveNews.languageChecked.value, let languageCode = Locale.preferredLanguages.first?.prefix(2) { - Preferences.BraveToday.languageChecked.value = true + Preferences.BraveNews.languageChecked.value = true // Base opt-in visibility on whether or not the user's language is supported in BT - Preferences.BraveToday.isShowingOptIn.value = FeedDataSource.supportedLanguages.contains(String(languageCode)) + Preferences.BraveNews.isShowingOptIn.value = FeedDataSource.supportedLanguages.contains(String(languageCode)) } #endif diff --git a/Client/Assets/Images.xcassets/Brave Today/Contents.json b/Client/Assets/Images.xcassets/Brave News/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/Contents.json rename to Client/Assets/Images.xcassets/Brave News/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/brave-today-error.imageset/Contents.json b/Client/Assets/Images.xcassets/Brave News/brave-today-error.imageset/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/brave-today-error.imageset/Contents.json rename to Client/Assets/Images.xcassets/Brave News/brave-today-error.imageset/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/brave-today-error.imageset/brave-today-error@2x.png b/Client/Assets/Images.xcassets/Brave News/brave-today-error.imageset/brave-today-error@2x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/brave-today-error.imageset/brave-today-error@2x.png rename to Client/Assets/Images.xcassets/Brave News/brave-today-error.imageset/brave-today-error@2x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/brave-today-error.imageset/brave-today-error@3x.png b/Client/Assets/Images.xcassets/Brave News/brave-today-error.imageset/brave-today-error@3x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/brave-today-error.imageset/brave-today-error@3x.png rename to Client/Assets/Images.xcassets/Brave News/brave-today-error.imageset/brave-today-error@3x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/brave-today-settings.imageset/Contents.json b/Client/Assets/Images.xcassets/Brave News/brave-today-settings.imageset/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/brave-today-settings.imageset/Contents.json rename to Client/Assets/Images.xcassets/Brave News/brave-today-settings.imageset/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/brave-today-settings.imageset/settings_toggles@2x.png b/Client/Assets/Images.xcassets/Brave News/brave-today-settings.imageset/settings_toggles@2x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/brave-today-settings.imageset/settings_toggles@2x.png rename to Client/Assets/Images.xcassets/Brave News/brave-today-settings.imageset/settings_toggles@2x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/brave-today-settings.imageset/settings_toggles@3x.png b/Client/Assets/Images.xcassets/Brave News/brave-today-settings.imageset/settings_toggles@3x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/brave-today-settings.imageset/settings_toggles@3x.png rename to Client/Assets/Images.xcassets/Brave News/brave-today-settings.imageset/settings_toggles@3x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/disable.feed.source.alert.imageset/Contents.json b/Client/Assets/Images.xcassets/Brave News/disable.feed.source.alert.imageset/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/disable.feed.source.alert.imageset/Contents.json rename to Client/Assets/Images.xcassets/Brave News/disable.feed.source.alert.imageset/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/disable.feed.source.alert.imageset/disable.source.feed.alert@2x.png b/Client/Assets/Images.xcassets/Brave News/disable.feed.source.alert.imageset/disable.source.feed.alert@2x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/disable.feed.source.alert.imageset/disable.source.feed.alert@2x.png rename to Client/Assets/Images.xcassets/Brave News/disable.feed.source.alert.imageset/disable.source.feed.alert@2x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/disable.feed.source.alert.imageset/disable.source.feed.alert@3x.png b/Client/Assets/Images.xcassets/Brave News/disable.feed.source.alert.imageset/disable.source.feed.alert@3x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/disable.feed.source.alert.imageset/disable.source.feed.alert@3x.png rename to Client/Assets/Images.xcassets/Brave News/disable.feed.source.alert.imageset/disable.source.feed.alert@3x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/disable.feed.source.symbolset/Contents.json b/Client/Assets/Images.xcassets/Brave News/disable.feed.source.symbolset/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/disable.feed.source.symbolset/Contents.json rename to Client/Assets/Images.xcassets/Brave News/disable.feed.source.symbolset/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/disable.feed.source.symbolset/brave.eye.slash.svg b/Client/Assets/Images.xcassets/Brave News/disable.feed.source.symbolset/brave.eye.slash.svg similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/disable.feed.source.symbolset/brave.eye.slash.svg rename to Client/Assets/Images.xcassets/Brave News/disable.feed.source.symbolset/brave.eye.slash.svg diff --git a/Client/Assets/Images.xcassets/Brave Today/enable.feed.source.symbolset/Contents.json b/Client/Assets/Images.xcassets/Brave News/enable.feed.source.symbolset/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/enable.feed.source.symbolset/Contents.json rename to Client/Assets/Images.xcassets/Brave News/enable.feed.source.symbolset/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/enable.feed.source.symbolset/brave.eye.svg b/Client/Assets/Images.xcassets/Brave News/enable.feed.source.symbolset/brave.eye.svg similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/enable.feed.source.symbolset/brave.eye.svg rename to Client/Assets/Images.xcassets/Brave News/enable.feed.source.symbolset/brave.eye.svg diff --git a/Client/Assets/Images.xcassets/Brave Today/graph-up.imageset/Contents.json b/Client/Assets/Images.xcassets/Brave News/graph-up.imageset/Contents.json similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/graph-up.imageset/Contents.json rename to Client/Assets/Images.xcassets/Brave News/graph-up.imageset/Contents.json diff --git a/Client/Assets/Images.xcassets/Brave Today/graph-up.imageset/graph-up@2x.png b/Client/Assets/Images.xcassets/Brave News/graph-up.imageset/graph-up@2x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/graph-up.imageset/graph-up@2x.png rename to Client/Assets/Images.xcassets/Brave News/graph-up.imageset/graph-up@2x.png diff --git a/Client/Assets/Images.xcassets/Brave Today/graph-up.imageset/graph-up@3x.png b/Client/Assets/Images.xcassets/Brave News/graph-up.imageset/graph-up@3x.png similarity index 100% rename from Client/Assets/Images.xcassets/Brave Today/graph-up.imageset/graph-up@3x.png rename to Client/Assets/Images.xcassets/Brave News/graph-up.imageset/graph-up@3x.png diff --git a/Client/Frontend/Brave Today/Cards/BraveTodayEmptyFeedView.swift b/Client/Frontend/Brave Today/Cards/BraveNewsEmptyFeedView.swift similarity index 91% rename from Client/Frontend/Brave Today/Cards/BraveTodayEmptyFeedView.swift rename to Client/Frontend/Brave Today/Cards/BraveNewsEmptyFeedView.swift index 9e57cdc62fc..27809a68273 100644 --- a/Client/Frontend/Brave Today/Cards/BraveTodayEmptyFeedView.swift +++ b/Client/Frontend/Brave Today/Cards/BraveNewsEmptyFeedView.swift @@ -8,7 +8,7 @@ import BraveUI import BraveShared import Shared -class BraveTodayEmptyFeedView: UIView, FeedCardContent { +class BraveNewsEmptyFeedView: UIView, FeedCardContent { var sourcesAndSettingsButtonTapped: (() -> Void)? @@ -23,7 +23,7 @@ class BraveTodayEmptyFeedView: UIView, FeedCardContent { private let sourcesAndSettingsButton = ActionButton(type: .system).then { $0.layer.borderWidth = 0 $0.titleLabel?.font = .systemFont(ofSize: 16.0, weight: .semibold) - $0.setTitle(Strings.BraveToday.sourcesAndSettings, for: .normal) + $0.setTitle(Strings.BraveNews.sourcesAndSettings, for: .normal) $0.contentEdgeInsets = UIEdgeInsets(top: 10, left: 20, bottom: 10, right: 20) $0.backgroundColor = UIColor.white.withAlphaComponent(0.2) } @@ -33,7 +33,7 @@ class BraveTodayEmptyFeedView: UIView, FeedCardContent { $0.textColor = .white $0.font = .systemFont(ofSize: 22, weight: .semibold) $0.numberOfLines = 0 - $0.text = Strings.BraveToday.emptyFeedTitle + $0.text = Strings.BraveNews.emptyFeedTitle } private let messageLabel = UILabel().then { @@ -41,7 +41,7 @@ class BraveTodayEmptyFeedView: UIView, FeedCardContent { $0.textColor = .white $0.font = .systemFont(ofSize: 16) $0.numberOfLines = 0 - $0.text = Strings.BraveToday.emptyFeedBody + $0.text = Strings.BraveNews.emptyFeedBody } required init() { diff --git a/Client/Frontend/Brave Today/Cards/BraveTodayErrorView.swift b/Client/Frontend/Brave Today/Cards/BraveNewsErrorView.swift similarity index 95% rename from Client/Frontend/Brave Today/Cards/BraveTodayErrorView.swift rename to Client/Frontend/Brave Today/Cards/BraveNewsErrorView.swift index df8b41e3d85..59c2f350ac4 100644 --- a/Client/Frontend/Brave Today/Cards/BraveTodayErrorView.swift +++ b/Client/Frontend/Brave Today/Cards/BraveNewsErrorView.swift @@ -8,7 +8,7 @@ import BraveUI import BraveShared import Shared -class BraveTodayErrorView: UIView, FeedCardContent { +class BraveNewsErrorView: UIView, FeedCardContent { var refreshButtonTapped: (() -> Void)? @@ -22,7 +22,7 @@ class BraveTodayErrorView: UIView, FeedCardContent { let refreshButton = ActionButton().then { $0.backgroundColor = .braveOrange - $0.setTitle(Strings.BraveToday.refresh, for: .normal) + $0.setTitle(Strings.BraveNews.refresh, for: .normal) $0.titleLabel?.font = .systemFont(ofSize: 15.0, weight: .semibold) $0.layer.borderWidth = 0 $0.loaderView = LoaderView(size: .small).then { diff --git a/Client/Frontend/Brave Today/Cards/BraveTodayOptInView.swift b/Client/Frontend/Brave Today/Cards/BraveNewsOptInView.swift similarity index 88% rename from Client/Frontend/Brave Today/Cards/BraveTodayOptInView.swift rename to Client/Frontend/Brave Today/Cards/BraveNewsOptInView.swift index 7d977ddd6b1..5d15277fc35 100644 --- a/Client/Frontend/Brave Today/Cards/BraveTodayOptInView.swift +++ b/Client/Frontend/Brave Today/Cards/BraveNewsOptInView.swift @@ -10,11 +10,11 @@ import Shared enum OptInCardAction { case closedButtonTapped - case turnOnBraveTodayButtonTapped + case turnOnBraveNewsButtonTapped case learnMoreButtonTapped } -class BraveTodayOptInView: UIView, FeedCardContent { +class BraveNewsOptInView: UIView, FeedCardContent { private let backgroundView = FeedCardBackgroundView() private let stackView = UIStackView().then { @@ -35,11 +35,11 @@ class BraveTodayOptInView: UIView, FeedCardContent { $0.accessibilityLabel = Strings.close } - let turnOnBraveTodayButton = ActionButton().then { + let turnOnBraveNewsButton = ActionButton().then { $0.layer.borderWidth = 0 $0.titleLabel?.font = .systemFont(ofSize: 16.0, weight: .semibold) $0.setTitleColor(.white, for: .normal) - $0.setTitle(Strings.BraveToday.turnOnBraveToday, for: .normal) + $0.setTitle(Strings.BraveNews.turnOnBraveNews, for: .normal) $0.contentEdgeInsets = UIEdgeInsets(top: 10, left: 20, bottom: 10, right: 20) $0.backgroundColor = .braveLighterBlurple $0.loaderView = LoaderView(size: .small).then { @@ -48,7 +48,7 @@ class BraveTodayOptInView: UIView, FeedCardContent { } private let learnMoreButton = UIButton(type: .system).then { - $0.setTitle(Strings.BraveToday.learnMoreTitle, for: .normal) + $0.setTitle(Strings.BraveNews.learnMoreTitle, for: .normal) $0.titleLabel?.font = .systemFont(ofSize: 15.0, weight: .semibold) $0.setTitleColor(.white, for: .normal) } @@ -70,14 +70,14 @@ class BraveTodayOptInView: UIView, FeedCardContent { .view(graphicAnimationView), .customSpace(30), .view(UILabel().then { - $0.text = Strings.BraveToday.introCardTitle + $0.text = Strings.BraveNews.introCardTitle $0.textAlignment = .center $0.textColor = .white $0.font = .systemFont(ofSize: 18, weight: .semibold) $0.numberOfLines = 0 }), .view(UILabel().then { - $0.text = Strings.BraveToday.introCardBody + $0.text = Strings.BraveNews.introCardBody $0.textAlignment = .center $0.textColor = .white $0.font = .systemFont(ofSize: 14) @@ -90,7 +90,7 @@ class BraveTodayOptInView: UIView, FeedCardContent { $0.addStackViewItems( .view(MaskedNewLabel()), .view(UILabel().then { - $0.text = Strings.BraveToday.introCardNewTextBody + $0.text = Strings.BraveNews.introCardNewTextBody $0.textAlignment = .center $0.textColor = .white $0.font = .systemFont(ofSize: 13) @@ -99,7 +99,7 @@ class BraveTodayOptInView: UIView, FeedCardContent { ) }), .customSpace(24), - .view(turnOnBraveTodayButton), + .view(turnOnBraveNewsButton), .view(learnMoreButton) ) @@ -109,7 +109,7 @@ class BraveTodayOptInView: UIView, FeedCardContent { closeButton.addTarget(self, action: #selector(tappedCloseButton), for: .touchUpInside) learnMoreButton.addTarget(self, action: #selector(tappedLearnMoreButton), for: .touchUpInside) - turnOnBraveTodayButton.addTarget(self, action: #selector(tappedTurnOnBraveButton), for: .touchUpInside) + turnOnBraveNewsButton.addTarget(self, action: #selector(tappedTurnOnBraveButton), for: .touchUpInside) } // MARK: - Actions @@ -123,7 +123,7 @@ class BraveTodayOptInView: UIView, FeedCardContent { } @objc private func tappedTurnOnBraveButton() { - optInCardActionHandler?(.turnOnBraveTodayButtonTapped) + optInCardActionHandler?(.turnOnBraveNewsButtonTapped) } @available(*, unavailable) @@ -152,7 +152,7 @@ private class MaskedNewLabel: UIView { $0.overrideUserInterfaceStyle = .light } private let label = UILabel().then { - $0.text = Strings.BraveToday.introCardNew.uppercased() + $0.text = Strings.BraveNews.introCardNew.uppercased() $0.textColor = .black $0.font = .systemFont(ofSize: 12, weight: .bold) } diff --git a/Client/Frontend/Brave Today/Cards/FeedGroupViews.swift b/Client/Frontend/Brave Today/Cards/FeedGroupViews.swift index 13b50742d7d..6ce97f9efab 100644 --- a/Client/Frontend/Brave Today/Cards/FeedGroupViews.swift +++ b/Client/Frontend/Brave Today/Cards/FeedGroupViews.swift @@ -144,7 +144,7 @@ class DealsFeedGroupView: FeedGroupView, FeedCardContent { $0.isAccessibilityElement = false }), .view(FeedCardFooterButton().then { - $0.label.text = Strings.BraveToday.moreBraveOffers + $0.label.text = Strings.BraveNews.moreBraveOffers $0.addTarget(self, action: #selector(tappedMoreOffers), for: .touchUpInside) }) ) diff --git a/Client/Frontend/Brave Today/Composer/FeedDataSource+RSS.swift b/Client/Frontend/Brave Today/Composer/FeedDataSource+RSS.swift index 6cc26a0ea5a..a53d4a2c1ff 100644 --- a/Client/Frontend/Brave Today/Composer/FeedDataSource+RSS.swift +++ b/Client/Frontend/Brave Today/Composer/FeedDataSource+RSS.swift @@ -19,11 +19,6 @@ struct RSSFeedLocation: Hashable { } extension FeedDataSource { - /// The maximum number of RSS sources that can be added - static let maximumNumberOfRSSFeeds = 5 - /// Whether or not OPML parsing is avaialable - static let isOPMLParsingAvailable = false - // MARK: - RSS Sources var rssFeedLocations: [RSSFeedLocation] { @@ -42,9 +37,6 @@ extension FeedDataSource { if !location.url.isWebPage(includeDataURIs: false) { return false } - if rssFeedLocations.count >= Self.maximumNumberOfRSSFeeds { - return false - } let feedUrl = location.url.absoluteString if RSSFeedSource.get(with: feedUrl) != nil { return false diff --git a/Client/Frontend/Brave Today/Composer/FeedDataSource.swift b/Client/Frontend/Brave Today/Composer/FeedDataSource.swift index 5e13372dabb..474b87d0920 100644 --- a/Client/Frontend/Brave Today/Composer/FeedDataSource.swift +++ b/Client/Frontend/Brave Today/Composer/FeedDataSource.swift @@ -13,7 +13,7 @@ import FeedKit // Named `logger` because we are using math function `log` private let logger = Logger.browserLogger -/// Powers Brave Today's feed. +/// Powers the Brave News feed. class FeedDataSource { /// The current view state of the data source enum State { @@ -72,7 +72,7 @@ class FeedDataSource { init() { restoreCachedSources() if !AppConstants.buildChannel.isPublic, - let savedEnvironment = Preferences.BraveToday.debugEnvironment.value, + let savedEnvironment = Preferences.BraveNews.debugEnvironment.value, let environment = Environment(rawValue: savedEnvironment) { self.environment = environment } @@ -91,14 +91,14 @@ class FeedDataSource { return decoder }() - /// A Brave Today environment + /// A Brave News environment enum Environment: String, CaseIterable { case dev = "brave.software" case staging = "bravesoftware.com" case production = "brave.com" } - /// The current Brave Today environment. + /// The current Brave News environment. /// /// Updating the environment automatically clears the current cached items if any exist. /// @@ -108,7 +108,7 @@ class FeedDataSource { if oldValue == environment { return } assert(!AppConstants.buildChannel.isPublic, "Environment cannot be changed on non-public build channels") - Preferences.BraveToday.debugEnvironment.value = environment.rawValue + Preferences.BraveNews.debugEnvironment.value = environment.rawValue clearCachedFiles() } } @@ -119,12 +119,12 @@ class FeedDataSource { "ja", ] - private struct TodayBucket { + private struct NewsBucket { var name: String var path: String = "" } - private func resourceUrl(for bucket: TodayBucket) -> URL? { + private func resourceUrl(for bucket: NewsBucket) -> URL? { var components = URLComponents() components.scheme = "https" components.host = "\(bucket.name).\(environment.rawValue)" @@ -132,22 +132,22 @@ class FeedDataSource { return components.url } - private struct TodayResource { - var bucket: TodayBucket + private struct NewsResource { + var bucket: NewsBucket var name: String var type: String var isLocalized: Bool var cacheLifetime: TimeInterval - static let sources = TodayResource( - bucket: TodayBucket(name: "brave-today-cdn"), + static let sources = NewsResource( + bucket: NewsBucket(name: "brave-today-cdn"), name: "sources", type: "json", isLocalized: true, cacheLifetime: 1.days ) - static let feed = TodayResource( - bucket: TodayBucket(name: "brave-today-cdn", path: "brave-today"), + static let feed = NewsResource( + bucket: NewsBucket(name: "brave-today-cdn", path: "brave-today"), name: "feed", type: "json", isLocalized: true, @@ -155,9 +155,9 @@ class FeedDataSource { ) } - /// Get the full name of a file for a given Brave Today resource, taking into account whether + /// Get the full name of a file for a given Brave News resource, taking into account whether /// or not the resource can be localized for supported languages - private func resourceFilename(for resource: TodayResource) -> String { + private func resourceFilename(for resource: NewsResource) -> String { // "en" is the default language and thus does not get the language code inserted into the // file name. if resource.isLocalized, let languageCode = Locale.preferredLanguages.first?.prefix(2), @@ -172,7 +172,7 @@ class FeedDataSource { /// Determine whether or not some cached resource is expired /// /// - Note: If no file can be found, this returns `true` - private func isResourceExpired(_ resource: TodayResource) -> Bool { + private func isResourceExpired(_ resource: NewsResource) -> Bool { let fileManager = FileManager.default let filename = resourceFilename(for: resource) let cachedPath = fileManager.getOrCreateFolder(name: Self.cacheFolderName)?.appendingPathComponent(filename).path @@ -184,14 +184,14 @@ class FeedDataSource { return true } - /// A set of Brave Today specific errors that could occur outside of JSON decoding or network errors - enum BraveTodayError: Error { + /// A set of Brave News specific errors that could occur outside of JSON decoding or network errors + enum BraveNewsError: Error { /// The resource data that was loaded was empty after parsing case resourceEmpty } - /// Get a cached Brave Today resource file, optionally allowing expired data to be returned - private func cachedResource(_ resource: TodayResource, loadExpiredData: Bool = false) -> Deferred { + /// Get a cached Brave News resource file, optionally allowing expired data to be returned + private func cachedResource(_ resource: NewsResource, loadExpiredData: Bool = false) -> Deferred { let name = resourceFilename(for: resource) let fileManager = FileManager.default let deferred = Deferred(value: nil, defaultQueue: .main) @@ -212,7 +212,7 @@ class FeedDataSource { return deferred } - /// Load a Brave Today resource either from a file cache or the web + /// Load a Brave News resource either from a file cache or the web /// /// The `filename` provided will be appended as a path component to the request URL, and be used to /// fetch the cache and save the response so it should include the full path for the endpoint (For @@ -221,7 +221,7 @@ class FeedDataSource { /// Cache lifetime will be based on the modification date of the cached file. Data downloaded from the web /// will only be cached if it is successfully decoded into the given `DataType`. private func loadResource( - _ resource: TodayResource, + _ resource: NewsResource, decodedTo: DataType.Type ) -> Deferred> where DataType: Decodable { let filename = resourceFilename(for: resource) @@ -284,7 +284,7 @@ class FeedDataSource { private func loadSources() -> Deferred> { loadResource(.sources, decodedTo: [FailableDecodable].self).map { result in if case .success(let sources) = result, sources.isEmpty { - return .failure(BraveTodayError.resourceEmpty) + return .failure(BraveNewsError.resourceEmpty) } return result.map { $0.compactMap(\.wrappedValue) @@ -295,7 +295,7 @@ class FeedDataSource { private func loadFeed() -> Deferred> { loadResource(.feed, decodedTo: [FailableDecodable].self).map { result in if case .success(let sources) = result, sources.isEmpty { - return .failure(BraveTodayError.resourceEmpty) + return .failure(BraveNewsError.resourceEmpty) } return result.map { $0.compactMap(\.wrappedValue) @@ -303,7 +303,7 @@ class FeedDataSource { } } - /// Describes a single RSS feed's loaded data set converted into Brave Today based data + /// Describes a single RSS feed's loaded data set converted into Brave News based data private struct RSSDataFeed { var source: FeedItem.Source var items: [FeedItem.Content] @@ -354,7 +354,7 @@ class FeedDataSource { return all(locations.map(loadRSSLocation)) } - /// Scores RSS items similar to how the backend scores regular Brave Today sources + /// Scores RSS items similar to how the backend scores regular Brave News sources private func scored(rssItems: [FeedItem.Content]) -> [FeedItem.Content] { var varianceBySource: [String: Double] = [:] return rssItems.map { @@ -391,7 +391,7 @@ class FeedDataSource { isResourceExpired(.sources) } - /// Loads Brave Today resources and generates cards for the loaded data. The result will be placed in + /// Loads Brave News resources and generates cards for the loaded data. The result will be placed in /// the `state` property. /// /// Resources are loaded either from cache (if the cache is valid for said resource) or from the web, @@ -435,10 +435,10 @@ class FeedDataSource { func clearCachedFiles() -> Bool { do { let fileManager = FileManager.default - if let braveTodayPath = fileManager.getOrCreateFolder(name: Self.cacheFolderName) { - let filePaths = try fileManager.contentsOfDirectory(atPath: braveTodayPath.path) + if let braveNewsPath = fileManager.getOrCreateFolder(name: Self.cacheFolderName) { + let filePaths = try fileManager.contentsOfDirectory(atPath: braveNewsPath.path) try filePaths.forEach { - var fileUrl = braveTodayPath + var fileUrl = braveNewsPath fileUrl.appendPathComponent($0) try fileManager.removeItem(atPath: fileUrl.path) } @@ -642,7 +642,7 @@ class FeedDataSource { case .deals: return fillStrategy.next(3, from: &deals).map { let title = $0.first?.content.offersCategory - return [.deals($0, title: title ?? Strings.BraveToday.deals)] + return [.deals($0, title: title ?? Strings.BraveNews.deals)] } case .partner: let imageExists = { (item: FeedItem) -> Bool in diff --git a/Client/Frontend/Brave Today/FeedCardContent.swift b/Client/Frontend/Brave Today/FeedCardContent.swift index 05723d0623f..fd5ac7059cd 100644 --- a/Client/Frontend/Brave Today/FeedCardContent.swift +++ b/Client/Frontend/Brave Today/FeedCardContent.swift @@ -5,7 +5,7 @@ import Foundation -/// The content of a card placed in the Brave Today section on the NTP +/// The content of a card placed in the Brave News section on the NTP protocol FeedCardContent { /// The content's view var view: UIView { get } diff --git a/Client/Frontend/Brave Today/FeedContextMenuDelegate.swift b/Client/Frontend/Brave Today/FeedContextMenuDelegate.swift index 004941cc254..a09033669de 100644 --- a/Client/Frontend/Brave Today/FeedContextMenuDelegate.swift +++ b/Client/Frontend/Brave Today/FeedContextMenuDelegate.swift @@ -8,7 +8,7 @@ import Shared /// Handles context menu related interactions on an item in the feed class FeedContextMenuDelegate: NSObject, UIContextMenuInteractionDelegate { - /// The identifier given to context menus created for Brave Today feed items + /// The identifier given to context menus created for Brave News feed items static let identifier = "feed-item" /// Called when a user performs a preview action /// diff --git a/Client/Frontend/Brave Today/FeedItemView.swift b/Client/Frontend/Brave Today/FeedItemView.swift index 3670c34ca99..db7058f72aa 100644 --- a/Client/Frontend/Brave Today/FeedItemView.swift +++ b/Client/Frontend/Brave Today/FeedItemView.swift @@ -153,7 +153,7 @@ extension FeedItemView { $0.tintColor = UIColor(white: 1.0, alpha: 0.8) } private let label = UILabel().then { - $0.text = Strings.BraveToday.promoted + $0.text = Strings.BraveNews.promoted $0.numberOfLines = 1 $0.font = .systemFont(ofSize: 12) $0.textColor = UIColor(white: 1.0, alpha: 0.8) diff --git a/Client/Frontend/Brave Today/FeedSectionHeaderView.swift b/Client/Frontend/Brave Today/FeedSectionHeaderView.swift index 981a76b7d6e..c00358ecdaa 100644 --- a/Client/Frontend/Brave Today/FeedSectionHeaderView.swift +++ b/Client/Frontend/Brave Today/FeedSectionHeaderView.swift @@ -7,11 +7,11 @@ import UIKit import BraveUI import Shared -/// The header which is shown when the user scrolls down into the Brave Today feed +/// The header which is shown when the user scrolls down into the Brave News feed class FeedSectionHeaderView: UIView { private let backgroundView: UIVisualEffectView private let label = UILabel().then { - $0.text = Strings.BraveToday.braveToday + $0.text = Strings.BraveNews.braveNews $0.textColor = .white $0.font = .systemFont(ofSize: 18, weight: .semibold) } @@ -19,7 +19,7 @@ class FeedSectionHeaderView: UIView { $0.setImage(UIImage(imageLiteralResourceName: "brave-today-settings"), for: .normal) $0.tintColor = .white $0.setContentHuggingPriority(.required, for: .horizontal) - $0.accessibilityLabel = Strings.BraveToday.sourcesAndSettings + $0.accessibilityLabel = Strings.BraveNews.sourcesAndSettings } private let shadowLine = UIView().then { diff --git a/Client/Frontend/Brave Today/Source List/FeedSourceListViewController.swift b/Client/Frontend/Brave Today/Source List/FeedSourceListViewController.swift index d10422ba642..e98a048e0a4 100644 --- a/Client/Frontend/Brave Today/Source List/FeedSourceListViewController.swift +++ b/Client/Frontend/Brave Today/Source List/FeedSourceListViewController.swift @@ -10,7 +10,7 @@ import Shared /// Displays a list of sources that may be optionally filtered down to a specific category class FeedSourceListViewController: UITableViewController { - /// The Brave Today feed data source + /// The Brave News feed data source let dataSource: FeedDataSource /// A category to filter the list of sources down to let category: String? @@ -77,7 +77,7 @@ class FeedSourceListViewController: UITableViewController { tableView.dataSource = self tableView.sectionIndexColor = .braveOrange - title = category ?? Strings.BraveToday.allSources + title = category ?? Strings.BraveNews.allSources if category != nil { // TODO(iOS14): Replace with context menu primary action navigationItem.rightBarButtonItem = .init( @@ -90,7 +90,7 @@ class FeedSourceListViewController: UITableViewController { let searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self - searchController.searchBar.placeholder = Strings.BraveToday.sourceSearchPlaceholder + searchController.searchBar.placeholder = Strings.BraveNews.sourceSearchPlaceholder searchController.obscuresBackgroundDuringPresentation = false navigationItem.hidesSearchBarWhenScrolling = true navigationItem.searchController = searchController @@ -99,10 +99,10 @@ class FeedSourceListViewController: UITableViewController { @objc private func tappedMenu(_ sender: UIBarButtonItem) { let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) alert.popoverPresentationController?.barButtonItem = sender - alert.addAction(UIAlertAction(title: Strings.BraveToday.enableAll, style: .default, handler: { [weak self] _ in + alert.addAction(UIAlertAction(title: Strings.BraveNews.enableAll, style: .default, handler: { [weak self] _ in self?.toggleCategory(enabled: true) })) - alert.addAction(UIAlertAction(title: Strings.BraveToday.disableAll, style: .destructive, handler: { [weak self] _ in + alert.addAction(UIAlertAction(title: Strings.BraveNews.disableAll, style: .destructive, handler: { [weak self] _ in self?.toggleCategory(enabled: false) })) alert.addAction(UIAlertAction(title: Strings.cancelButtonTitle, style: .cancel)) diff --git a/Client/Frontend/Browser/BrowserViewController.swift b/Client/Frontend/Browser/BrowserViewController.swift index 3f0537fe9f6..063202ad1c4 100644 --- a/Client/Frontend/Browser/BrowserViewController.swift +++ b/Client/Frontend/Browser/BrowserViewController.swift @@ -1616,7 +1616,7 @@ class BrowserViewController: UIViewController { } activities.append(requestDesktopSiteActivity) - if Preferences.BraveToday.isEnabled.value, let metadata = tab?.pageMetadata, + if Preferences.BraveNews.isEnabled.value, let metadata = tab?.pageMetadata, !metadata.feeds.isEmpty { let feeds: [RSSFeedLocation] = metadata.feeds.compactMap { feed in if let url = URL(string: feed.href) { @@ -1625,9 +1625,9 @@ class BrowserViewController: UIViewController { return nil } if !feeds.isEmpty { - let addToBraveToday = AddFeedToBraveTodayActivity() { [weak self] in + let addToBraveNews = AddFeedToBraveNewsActivity() { [weak self] in guard let self = self else { return } - let controller = BraveTodayAddSourceResultsViewController( + let controller = BraveNewsAddSourceResultsViewController( dataSource: self.feedDataSource, searchedURL: url, rssFeedLocations: feeds, @@ -1642,7 +1642,7 @@ class BrowserViewController: UIViewController { } self.present(container, animated: true) } - activities.append(addToBraveToday) + activities.append(addToBraveNews) } } @@ -1680,9 +1680,9 @@ class BrowserViewController: UIViewController { let tabURL = selectedTab.url { let parser = FeedParser(URL: url) if case .success(let feed) = parser.parse() { - let addToBraveToday = AddFeedToBraveTodayActivity() { [weak self] in + let addToBraveNews = AddFeedToBraveNewsActivity() { [weak self] in guard let self = self else { return } - let controller = BraveTodayAddSourceResultsViewController( + let controller = BraveNewsAddSourceResultsViewController( dataSource: self.feedDataSource, searchedURL: tabURL, rssFeedLocations: [.init(title: feed.title, url: tabURL)], @@ -1697,7 +1697,7 @@ class BrowserViewController: UIViewController { } self.present(container, animated: true) } - activities.append(addToBraveToday) + activities.append(addToBraveNews) } } } diff --git a/Client/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift b/Client/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift index 4955d0e2841..d6cbace2d45 100644 --- a/Client/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift +++ b/Client/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift @@ -80,7 +80,7 @@ class NewTabPageBackgroundButtonsView: UIView, PreferencesObserver { override init(frame: CGRect) { super.init(frame: frame) - Preferences.BraveToday.isEnabled.observe(from: self) + Preferences.BraveNews.isEnabled.observe(from: self) backgroundColor = .clear addLayoutGuide(collectionViewSafeAreaLayoutGuide) @@ -104,22 +104,22 @@ class NewTabPageBackgroundButtonsView: UIView, PreferencesObserver { let isLandscape = frame.width > frame.height - #if NO_BRAVE_TODAY - let braveTodayVisible = false + #if NO_BRAVE_NEWS + let braveNewsVisible = false #else - let braveTodayVisible = + let braveNewsVisible = !PrivateBrowsingManager.shared.isPrivateBrowsing && - (Preferences.BraveToday.isEnabled.value || Preferences.BraveToday.isShowingOptIn.value) + (Preferences.BraveNews.isEnabled.value || Preferences.BraveNews.isShowingOptIn.value) #endif imageCreditButton.snp.remakeConstraints { $0.leading.equalTo(collectionViewSafeAreaLayoutGuide).inset(16) - $0.bottom.equalTo(collectionViewSafeAreaLayoutGuide).inset(16 + (braveTodayVisible ? 30 : 0)) + $0.bottom.equalTo(collectionViewSafeAreaLayoutGuide).inset(16 + (braveNewsVisible ? 30 : 0)) } sponsorLogoButton.snp.remakeConstraints { $0.size.equalTo(170) - $0.bottom.equalTo(collectionViewSafeAreaLayoutGuide.snp.bottom).inset(10 + (braveTodayVisible ? 30 : 0)) + $0.bottom.equalTo(collectionViewSafeAreaLayoutGuide.snp.bottom).inset(10 + (braveNewsVisible ? 30 : 0)) if isLandscape { $0.left.equalTo(collectionViewSafeAreaLayoutGuide.snp.left).offset(20) @@ -130,7 +130,7 @@ class NewTabPageBackgroundButtonsView: UIView, PreferencesObserver { qrCodeButton.snp.remakeConstraints { $0.size.equalTo(48) - $0.bottom.equalTo(collectionViewSafeAreaLayoutGuide.snp.bottom).inset(24 + (braveTodayVisible ? 30 : 0)) + $0.bottom.equalTo(collectionViewSafeAreaLayoutGuide.snp.bottom).inset(24 + (braveNewsVisible ? 30 : 0)) if isLandscape { $0.left.equalTo(collectionViewSafeAreaLayoutGuide.snp.left).offset(48) diff --git a/Client/Frontend/Browser/New Tab Page/NewTabPageFeedOverlayView.swift b/Client/Frontend/Browser/New Tab Page/NewTabPageFeedOverlayView.swift index 8a0f388d269..46bbc89ea6a 100644 --- a/Client/Frontend/Browser/New Tab Page/NewTabPageFeedOverlayView.swift +++ b/Client/Frontend/Browser/New Tab Page/NewTabPageFeedOverlayView.swift @@ -9,7 +9,7 @@ import BraveShared import SnapKit import Shared -/// A set of feed related components that overlay the New Tab Page when Brave Today is enabled +/// A set of feed related components that overlay the New Tab Page when Brave News is enabled class NewTabPageFeedOverlayView: UIView { let headerView = FeedSectionHeaderView().then { @@ -89,7 +89,7 @@ class NewTabPageFeedOverlayView: UIView { class NewContentAvailableButton: SpringButton { private let textLabel = UILabel().then { $0.textAlignment = .center - $0.text = Strings.BraveToday.contentAvailableButtonTitle + $0.text = Strings.BraveNews.contentAvailableButtonTitle $0.numberOfLines = 0 $0.textColor = .white $0.font = .systemFont(ofSize: 14.0, weight: .semibold) diff --git a/Client/Frontend/Browser/New Tab Page/NewTabPageFlowLayout.swift b/Client/Frontend/Browser/New Tab Page/NewTabPageFlowLayout.swift index a25f6ce1a38..c890e9648f4 100644 --- a/Client/Frontend/Browser/New Tab Page/NewTabPageFlowLayout.swift +++ b/Client/Frontend/Browser/New Tab Page/NewTabPageFlowLayout.swift @@ -10,10 +10,10 @@ import Foundation /// Handles correcting center-aligned single items in a flow layout while using /// automatic sizing cells class NewTabPageFlowLayout: UICollectionViewFlowLayout { - /// Brave Today section acts a little differently, as it is pushed to the bottom of the screen despite + /// Brave News section acts a little differently, as it is pushed to the bottom of the screen despite /// there being space between, therefore additional space has to be given to the overall content size - /// when Brave Today is enabled - var braveTodaySection: Int? { + /// when Brave News is enabled + var braveNewsSection: Int? { didSet { invalidateLayout() } @@ -35,18 +35,18 @@ class NewTabPageFlowLayout: UICollectionViewFlowLayout { override func prepare() { super.prepare() - if let braveTodaySection = braveTodaySection, + if let braveNewsSection = braveNewsSection, let collectionView = collectionView, - collectionView.numberOfItems(inSection: braveTodaySection) != 0, - let attribute = super.layoutAttributesForItem(at: IndexPath(item: 0, section: braveTodaySection)) { + collectionView.numberOfItems(inSection: braveNewsSection) != 0, + let attribute = super.layoutAttributesForItem(at: IndexPath(item: 0, section: braveNewsSection)) { let diff = collectionView.frame.height - attribute.frame.minY gapLength = diff - gapPadding - // Obtain the total height of the Brave Today section to calculate any extra height to be added + // Obtain the total height of the Brave News section to calculate any extra height to be added // to the content size. The extra height will ensure that there is always enough space to scroll // the header into full-visibility - let numberOfItems = collectionView.numberOfItems(inSection: braveTodaySection) - if let lastItemAttribute = super.layoutAttributesForItem(at: IndexPath(item: numberOfItems - 1, section: braveTodaySection)) { + let numberOfItems = collectionView.numberOfItems(inSection: braveNewsSection) + if let lastItemAttribute = super.layoutAttributesForItem(at: IndexPath(item: numberOfItems - 1, section: braveNewsSection)) { if lastItemAttribute.frame.maxY - attribute.frame.minY < collectionView.bounds.height - gapPadding { extraHeight = (collectionView.bounds.height - gapPadding) - (lastItemAttribute.frame.maxY - attribute.frame.minY) } @@ -98,7 +98,7 @@ class NewTabPageFlowLayout: UICollectionViewFlowLayout { } } - if let braveTodaySection = braveTodaySection, indexPath.section == braveTodaySection { + if let section = braveNewsSection, indexPath.section == section { attribute.frame.origin.y += gapLength } @@ -122,16 +122,16 @@ class NewTabPageFlowLayout: UICollectionViewFlowLayout { override var collectionViewContentSize: CGSize { var size = super.collectionViewContentSize - if braveTodaySection != nil { + if braveNewsSection != nil { size.height += gapLength + extraHeight } return size } override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint { - guard let braveTodaySection = braveTodaySection, - collectionView?.numberOfItems(inSection: braveTodaySection) != 0, - let item = layoutAttributesForItem(at: IndexPath(item: 0, section: braveTodaySection)) else { + guard let section = braveNewsSection, + collectionView?.numberOfItems(inSection: section) != 0, + let item = layoutAttributesForItem(at: IndexPath(item: 0, section: section)) else { return proposedContentOffset } var offset = proposedContentOffset @@ -148,9 +148,9 @@ class NewTabPageFlowLayout: UICollectionViewFlowLayout { forPreferredLayoutAttributes preferredAttributes: UICollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: UICollectionViewLayoutAttributes ) -> Bool { - if let braveTodaySection = braveTodaySection, + if let section = braveNewsSection, preferredAttributes.representedElementCategory == .cell, - preferredAttributes.indexPath.section == braveTodaySection { + preferredAttributes.indexPath.section == section { return preferredAttributes.size.height.rounded() != originalAttributes.size.height.rounded() } return super.shouldInvalidateLayout( @@ -168,7 +168,7 @@ class NewTabPageFlowLayout: UICollectionViewFlowLayout { withOriginalAttributes: originalAttributes ) - guard let collectionView = collectionView, let _ = braveTodaySection else { + guard let collectionView = collectionView, let _ = braveNewsSection else { return context } diff --git a/Client/Frontend/Browser/New Tab Page/NewTabPageViewController.swift b/Client/Frontend/Browser/New Tab Page/NewTabPageViewController.swift index 3c3b98ebcb3..6c77d2add2f 100644 --- a/Client/Frontend/Browser/New Tab Page/NewTabPageViewController.swift +++ b/Client/Frontend/Browser/New Tab Page/NewTabPageViewController.swift @@ -98,7 +98,7 @@ class NewTabPageViewController: UIViewController { private let feedDataSource: FeedDataSource private let feedOverlayView = NewTabPageFeedOverlayView() - private var preventReloadOnBraveTodayEnabledChange = false + private var preventReloadOnBraveNewsEnabledChange = false private let notifications: NewTabPageNotifications @@ -135,18 +135,18 @@ class NewTabPageViewController: UIViewController { sections.insert(NTPDefaultBrowserCalloutProvider(), at: 0) } - #if !NO_BRAVE_TODAY + #if !NO_BRAVE_NEWS if !PrivateBrowsingManager.shared.isPrivateBrowsing { sections.append( - BraveTodaySectionProvider( + BraveNewsSectionProvider( dataSource: feedDataSource, ads: rewards.ads, actionHandler: { [weak self] in - self?.handleBraveTodayAction($0) + self?.handleBraveNewsAction($0) } ) ) - layout.braveTodaySection = sections.firstIndex(where: { $0 is BraveTodaySectionProvider }) + layout.braveNewsSection = sections.firstIndex(where: { $0 is BraveNewsSectionProvider }) } #endif @@ -157,8 +157,8 @@ class NewTabPageViewController: UIViewController { self?.setupBackgroundImage() } - #if !NO_BRAVE_TODAY - Preferences.BraveToday.isEnabled.observe(from: self) + #if !NO_BRAVE_NEWS + Preferences.BraveNews.isEnabled.observe(from: self) feedDataSource.observeState(from: self) { [weak self] in self?.handleFeedStateChange($0, $1) } @@ -184,9 +184,9 @@ class NewTabPageViewController: UIViewController { collectionView.backgroundView = backgroundButtonsView - feedOverlayView.headerView.settingsButton.addTarget(self, action: #selector(tappedBraveTodaySettings), for: .touchUpInside) + feedOverlayView.headerView.settingsButton.addTarget(self, action: #selector(tappedBraveNewsSettings), for: .touchUpInside) if !AppConstants.buildChannel.isPublic { - feedOverlayView.headerView.settingsButton.addGestureRecognizer(UILongPressGestureRecognizer(target: self, action: #selector(longPressedBraveTodaySettingsButton))) + feedOverlayView.headerView.settingsButton.addGestureRecognizer(UILongPressGestureRecognizer(target: self, action: #selector(longPressedBraveNewsSettingsButton))) } feedOverlayView.newContentAvailableButton.addTarget(self, action: #selector(tappedNewContentAvailable), for: .touchUpInside) @@ -456,13 +456,13 @@ class NewTabPageViewController: UIViewController { notificationController = nil } - // MARK: - Brave Today + // MARK: - Brave News - private func handleBraveTodayAction(_ action: BraveTodaySectionProvider.Action) { + private func handleBraveNewsAction(_ action: BraveNewsSectionProvider.Action) { switch action { case .optInCardAction(.closedButtonTapped): - Preferences.BraveToday.isShowingOptIn.value = false - if let section = layout.braveTodaySection, collectionView.numberOfItems(inSection: section) != 0 { + Preferences.BraveNews.isShowingOptIn.value = false + if let section = layout.braveNewsSection, collectionView.numberOfItems(inSection: section) != 0 { collectionView.deleteItems(at: [IndexPath(item: 0, section: section)]) } collectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .top, animated: true) @@ -472,15 +472,15 @@ class NewTabPageViewController: UIViewController { self.backgroundButtonsView.alpha = 1.0 } case .optInCardAction(.learnMoreButtonTapped): - delegate?.navigateToInput(BraveUX.braveTodayPrivacyURL.absoluteString, inNewTab: false, switchingToPrivateMode: false) - case .optInCardAction(.turnOnBraveTodayButtonTapped): - preventReloadOnBraveTodayEnabledChange = true - Preferences.BraveToday.userOptedIn.value = true - Preferences.BraveToday.isShowingOptIn.value = false - Preferences.BraveToday.isEnabled.value = true + delegate?.navigateToInput(BraveUX.braveNewsPrivacyURL.absoluteString, inNewTab: false, switchingToPrivateMode: false) + case .optInCardAction(.turnOnBraveNewsButtonTapped): + preventReloadOnBraveNewsEnabledChange = true + Preferences.BraveNews.userOptedIn.value = true + Preferences.BraveNews.isShowingOptIn.value = false + Preferences.BraveNews.isEnabled.value = true loadFeedContents() case .emptyCardTappedSourcesAndSettings: - tappedBraveTodaySettings() + tappedBraveNewsSettings() case .errorCardTappedRefresh: loadFeedContents() case .moreBraveOffersTapped: @@ -491,7 +491,7 @@ class NewTabPageViewController: UIViewController { ) case .bravePartnerLearnMoreTapped: delegate?.navigateToInput( - BraveUX.braveTodayPartnersURL.absoluteString, + BraveUX.braveNewsPartnersURL.absoluteString, inNewTab: false, switchingToPrivateMode: false ) @@ -517,8 +517,8 @@ class NewTabPageViewController: UIViewController { if isEnabled { let alert = FeedActionAlertView( image: UIImage(imageLiteralResourceName: "disable.feed.source.alert"), - title: Strings.BraveToday.disabledAlertTitle, - message: String(format: Strings.BraveToday.disabledAlertBody, context.item.source.name) + title: Strings.BraveNews.disabledAlertTitle, + message: String(format: Strings.BraveNews.disabledAlertBody, context.item.source.name) ) alert.present(on: self) } @@ -535,7 +535,7 @@ class NewTabPageViewController: UIViewController { _ oldValue: FeedDataSource.State, _ newValue: FeedDataSource.State ) { - guard let braveTodaySection = layout.braveTodaySection else { return } + guard let section = layout.braveNewsSection else { return } func _completeLoading() { UIView.animate(withDuration: 0.2, animations: { @@ -549,7 +549,7 @@ class NewTabPageViewController: UIViewController { collectionView.reloadData() collectionView.layoutIfNeeded() let cells = collectionView.indexPathsForVisibleItems - .filter { $0.section == braveTodaySection } + .filter { $0.section == section } .compactMap(collectionView.cellForItem(at:)) cells.forEach { cell in cell.transform = .init(translationX: 0, y: 200) @@ -558,7 +558,7 @@ class NewTabPageViewController: UIViewController { }, completion: nil) } } else { - collectionView.reloadSections(IndexSet(integer: braveTodaySection)) + collectionView.reloadSections(IndexSet(integer: section)) } } @@ -572,18 +572,18 @@ class NewTabPageViewController: UIViewController { break case (.loading(.failure(let error1 as NSError)), .failure(let error2 as NSError)) where error1 == error2: - if let cell = collectionView.cellForItem(at: IndexPath(item: 0, section: braveTodaySection)) as? FeedCardCell { + if let cell = collectionView.cellForItem(at: IndexPath(item: 0, section: section)) as? FeedCardCell { cell.content.refreshButton.isLoading = false } else { _completeLoading() } case (_, .loading): if collectionView.contentOffset.y == collectionView.contentInset.top || - collectionView.numberOfItems(inSection: braveTodaySection) == 0 { + collectionView.numberOfItems(inSection: section) == 0 { feedOverlayView.loaderView.isHidden = false feedOverlayView.loaderView.start() - if let section = layout.braveTodaySection { + if let section = layout.braveNewsSection { let numberOfItems = collectionView.numberOfItems(inSection: section) if numberOfItems > 0 { collectionView.deleteItems( @@ -595,13 +595,13 @@ class NewTabPageViewController: UIViewController { case (.loading, _): _completeLoading() default: - collectionView.reloadSections(IndexSet(integer: braveTodaySection)) + collectionView.reloadSections(IndexSet(integer: section)) } } @objc private func checkForUpdatedFeed() { - #if !NO_BRAVE_TODAY - if !isBraveTodayVisible || Preferences.BraveToday.isShowingOptIn.value { return } + #if !NO_BRAVE_NEWS + if !isBraveNewsVisible || Preferences.BraveNews.isShowingOptIn.value { return } if collectionView.contentOffset.y == collectionView.contentInset.top { // Reload contents if the user is not currently scrolled into the feed loadFeedContents() @@ -643,8 +643,8 @@ class NewTabPageViewController: UIViewController { } } - @objc private func tappedBraveTodaySettings() { - let controller = BraveTodaySettingsViewController(dataSource: feedDataSource) + @objc private func tappedBraveNewsSettings() { + let controller = BraveNewsSettingsViewController(dataSource: feedDataSource) let container = UINavigationController(rootViewController: controller) present(container, animated: true) } @@ -709,10 +709,10 @@ class NewTabPageViewController: UIViewController { present(alert, animated: true, completion: nil) } - @objc private func longPressedBraveTodaySettingsButton() { + @objc private func longPressedBraveNewsSettingsButton() { assert(!AppConstants.buildChannel.isPublic, "Debug settings are not accessible on public builds") - let settings = BraveTodayDebugSettingsController(dataSource: feedDataSource) + let settings = BraveNewsDebugSettingsController(dataSource: feedDataSource) let container = UINavigationController(rootViewController: settings) present(container, animated: true) } @@ -720,35 +720,35 @@ class NewTabPageViewController: UIViewController { extension NewTabPageViewController: PreferencesObserver { func preferencesDidChange(for key: String) { - if !preventReloadOnBraveTodayEnabledChange { + if !preventReloadOnBraveNewsEnabledChange { collectionView.reloadData() } - if !isBraveTodayVisible { + if !isBraveNewsVisible { collectionView.verticalScrollIndicatorInsets = .zero feedOverlayView.headerView.alpha = 0.0 backgroundButtonsView.alpha = 1.0 } - preventReloadOnBraveTodayEnabledChange = false + preventReloadOnBraveNewsEnabledChange = false } } // MARK: - UIScrollViewDelegate extension NewTabPageViewController { - var isBraveTodayVisible: Bool { - #if NO_BRAVE_TODAY + var isBraveNewsVisible: Bool { + #if NO_BRAVE_NEWS return false #else return !PrivateBrowsingManager.shared.isPrivateBrowsing && - (Preferences.BraveToday.isEnabled.value || Preferences.BraveToday.isShowingOptIn.value) + (Preferences.BraveNews.isEnabled.value || Preferences.BraveNews.isShowingOptIn.value) #endif } func scrollViewDidScroll(_ scrollView: UIScrollView) { - guard isBraveTodayVisible, let braveTodaySection = layout.braveTodaySection else { return } - if collectionView.numberOfItems(inSection: braveTodaySection) > 0 { - // Hide the buttons as BraveToday feeds appear + guard isBraveNewsVisible, let newsSection = layout.braveNewsSection else { return } + if collectionView.numberOfItems(inSection: newsSection) > 0 { + // Hide the buttons as Brave News feeds appear backgroundButtonsView.alpha = 1.0 - max(0.0, min(1.0, (scrollView.contentOffset.y - scrollView.contentInset.top) / 16)) - // Show the header as BraveToday feeds appear - // Offset of where Brave Today starts + // Show the header as Brave News feeds appear + // Offset of where Brave News starts let todayStart = collectionView.frame.height - feedOverlayView.headerView.bounds.height - 32 - 16 // Offset of where the header should begin becoming visible let alphaInStart = collectionView.frame.height / 2.0 diff --git a/Client/Frontend/Browser/New Tab Page/Sections/BraveTodaySectionProvider.swift b/Client/Frontend/Browser/New Tab Page/Sections/BraveNewsSectionProvider.swift similarity index 91% rename from Client/Frontend/Browser/New Tab Page/Sections/BraveTodaySectionProvider.swift rename to Client/Frontend/Browser/New Tab Page/Sections/BraveNewsSectionProvider.swift index ff06fd7740d..efdba7c73f2 100644 --- a/Client/Frontend/Browser/New Tab Page/Sections/BraveTodaySectionProvider.swift +++ b/Client/Frontend/Browser/New Tab Page/Sections/BraveNewsSectionProvider.swift @@ -19,9 +19,9 @@ struct FeedItemActionContext { var indexPath: IndexPath } -/// The section provider for Brave Today. -class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { - /// Set of actions that can occur from the Brave Today section +/// The section provider for Brave News. +class BraveNewsSectionProvider: NSObject, NTPObservableSectionProvider { + /// Set of actions that can occur from the Brave News section enum Action { /// The user interacted with the welcome card case optInCardAction(OptInCardAction) @@ -53,9 +53,9 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } func registerCells(to collectionView: UICollectionView) { - collectionView.register(FeedCardCell.self) - collectionView.register(FeedCardCell.self) - collectionView.register(FeedCardCell.self) + collectionView.register(FeedCardCell.self) + collectionView.register(FeedCardCell.self) + collectionView.register(FeedCardCell.self) collectionView.register(FeedCardCell.self) collectionView.register(FeedCardCell.self) collectionView.register(FeedCardCell.self) @@ -71,14 +71,14 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } private var isShowingOptInCard: Bool { - Preferences.BraveToday.isShowingOptIn.value + Preferences.BraveNews.isShowingOptIn.value } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { if isShowingOptInCard { return 1 } - if !Preferences.BraveToday.isEnabled.value { + if !Preferences.BraveNews.isEnabled.value { return 0 } switch dataSource.state { @@ -118,7 +118,7 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { - if indexPath.item == 0, let cell = cell as? FeedCardCell { + if indexPath.item == 0, let cell = cell as? FeedCardCell { cell.content.graphicAnimationView.play() } if let card = dataSource.state.cards?[safe: indexPath.item] { @@ -134,20 +134,20 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { - if indexPath.item == 0, let cell = cell as? FeedCardCell { + if indexPath.item == 0, let cell = cell as? FeedCardCell { cell.content.graphicAnimationView.stop() } } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if let error = dataSource.state.error { - let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedCardCell + let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedCardCell if let urlError = error as? URLError, urlError.code == .notConnectedToInternet { - cell.content.titleLabel.text = Strings.BraveToday.errorNoInternetTitle - cell.content.errorMessageLabel.text = Strings.BraveToday.errorNoInternetBody + cell.content.titleLabel.text = Strings.BraveNews.errorNoInternetTitle + cell.content.errorMessageLabel.text = Strings.BraveNews.errorNoInternetBody } else { - cell.content.titleLabel.text = Strings.BraveToday.errorGeneralTitle - cell.content.errorMessageLabel.text = Strings.BraveToday.errorGeneralBody + cell.content.titleLabel.text = Strings.BraveNews.errorGeneralTitle + cell.content.errorMessageLabel.text = Strings.BraveNews.errorGeneralBody } if case .loading = dataSource.state { cell.content.refreshButton.isLoading = true @@ -164,10 +164,10 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } if isShowingOptInCard && indexPath.item == 0 { - let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedCardCell + let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedCardCell cell.content.optInCardActionHandler = { [weak self] action in - if action == .turnOnBraveTodayButtonTapped && !cell.content.turnOnBraveTodayButton.isLoading { - cell.content.turnOnBraveTodayButton.isLoading = true + if action == .turnOnBraveNewsButtonTapped && !cell.content.turnOnBraveNewsButton.isLoading { + cell.content.turnOnBraveNewsButton.isLoading = true } self?.actionHandler(.optInCardAction(action)) } @@ -175,7 +175,7 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } if let cards = dataSource.state.cards, cards.isEmpty { - let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedCardCell + let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedCardCell cell.content.sourcesAndSettingsButtonTapped = { [weak self] in self?.actionHandler(.emptyCardTappedSourcesAndSettings) } @@ -322,16 +322,16 @@ class BraveTodaySectionProvider: NSObject, NTPObservableSectionProvider { } var disableSource: UIAction { - .init(title: String(format: Strings.BraveToday.disablePublisherContent, item.source.name), image: UIImage(named: "disable.feed.source"), attributes: .destructive, handler: mapDeferredHandler(toggleSourceHandler)) + .init(title: String(format: Strings.BraveNews.disablePublisherContent, item.source.name), image: UIImage(named: "disable.feed.source"), attributes: .destructive, handler: mapDeferredHandler(toggleSourceHandler)) } var enableSource: UIAction { - .init(title: String(format: Strings.BraveToday.enablePublisherContent, item.source.name), image: UIImage(named: "enable.feed.source"), handler: mapDeferredHandler(toggleSourceHandler)) + .init(title: String(format: Strings.BraveNews.enablePublisherContent, item.source.name), image: UIImage(named: "enable.feed.source"), handler: mapDeferredHandler(toggleSourceHandler)) } let openActions: [UIAction] = [ openInNewTab, - // Brave Today is only available in normal tabs, so this isn't technically required + // Brave News is only available in normal tabs, so this isn't technically required // but good to be on the safe side !PrivateBrowsingManager.shared.isPrivateBrowsing ? openInNewPrivateTab : diff --git a/Client/Frontend/Settings/Brave Today/BraveTodayAddSourceResultsViewController.swift b/Client/Frontend/Settings/Brave News/BraveNewsAddSourceResultsViewController.swift similarity index 80% rename from Client/Frontend/Settings/Brave Today/BraveTodayAddSourceResultsViewController.swift rename to Client/Frontend/Settings/Brave News/BraveNewsAddSourceResultsViewController.swift index cfaeec16ecf..7734005c667 100644 --- a/Client/Frontend/Settings/Brave Today/BraveTodayAddSourceResultsViewController.swift +++ b/Client/Frontend/Settings/Brave News/BraveNewsAddSourceResultsViewController.swift @@ -7,7 +7,7 @@ import Foundation import BraveUI import Shared -class BraveTodayAddSourceResultsViewController: UITableViewController { +class BraveNewsAddSourceResultsViewController: UITableViewController { let feedDataSource: FeedDataSource let searchedURL: URL @@ -43,7 +43,7 @@ class BraveTodayAddSourceResultsViewController: UITableViewController { } private lazy var doneButton = UIBarButtonItem( - title: Strings.BraveToday.addSourceAddButtonTitle, + title: Strings.BraveNews.addSourceAddButtonTitle, style: .done, target: self, action: #selector(tappedAdd) @@ -65,22 +65,7 @@ class BraveTodayAddSourceResultsViewController: UITableViewController { } } - private func showMaximumReachedAlert() { - let alert = UIAlertController( - title: Strings.BraveToday.rssFeedLimitExceededAlertTitle, - message: Strings.BraveToday.rssFeedLimitExceededAlertMessage, - preferredStyle: .alert - ) - alert.addAction(.init(title: Strings.OKString, style: .default)) - present(alert, animated: true) - } - @objc private func tappedAdd() { - let numberOfAddedFeeds = feedDataSource.rssFeedLocations.count - if numberOfAddedFeeds + selectedLocations.count > FeedDataSource.maximumNumberOfRSSFeeds { - showMaximumReachedAlert() - return - } // Add selected sources to feed for location in selectedLocations { feedDataSource.addRSSFeedLocation(location) @@ -135,15 +120,7 @@ class BraveTodayAddSourceResultsViewController: UITableViewController { override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { if section == 1 { - return Strings.BraveToday.insecureSourcesHeader - } - return nil - } - - override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { - if section == tableView.numberOfSections - 1 { - let feedCount = feedDataSource.rssFeedLocations.count - return String.localizedStringWithFormat(Strings.BraveToday.rssFeedLimitRemainingFooter, feedCount) + return Strings.BraveNews.insecureSourcesHeader } return nil } diff --git a/Client/Frontend/Settings/Brave Today/BraveTodayAddSourceViewController.swift b/Client/Frontend/Settings/Brave News/BraveNewsAddSourceViewController.swift similarity index 90% rename from Client/Frontend/Settings/Brave Today/BraveTodayAddSourceViewController.swift rename to Client/Frontend/Settings/Brave News/BraveNewsAddSourceViewController.swift index ac7b22a8f1d..ba8d476b856 100644 --- a/Client/Frontend/Settings/Brave Today/BraveTodayAddSourceViewController.swift +++ b/Client/Frontend/Settings/Brave News/BraveNewsAddSourceViewController.swift @@ -10,7 +10,7 @@ import BraveUI import Fuzi import FeedKit -class BraveTodayAddSourceViewController: UITableViewController { +class BraveNewsAddSourceViewController: UITableViewController { private let feedDataSource: FeedDataSource var sourcesAdded: ((Set) -> Void)? @@ -49,7 +49,7 @@ class BraveTodayAddSourceViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() - title = Strings.BraveToday.addSource + title = Strings.BraveNews.addSource navigationController?.navigationBar.prefersLargeTitles = true navigationItem.largeTitleDisplayMode = .always @@ -103,7 +103,7 @@ class BraveTodayAddSourceViewController: UITableViewController { }() private func displayError(_ error: FindFeedsError) { - let alert = UIAlertController(title: Strings.BraveToday.addSourceFailureTitle, message: error.localizedDescription, preferredStyle: .alert) + let alert = UIAlertController(title: Strings.BraveNews.addSourceFailureTitle, message: error.localizedDescription, preferredStyle: .alert) alert.addAction(.init(title: Strings.OKString, style: .default, handler: nil)) present(alert, animated: true) } @@ -120,7 +120,7 @@ class BraveTodayAddSourceViewController: UITableViewController { self.isLoading = false switch result { case .success(let data): - let resultsController = BraveTodayAddSourceResultsViewController( + let resultsController = BraveNewsAddSourceResultsViewController( dataSource: self.feedDataSource, searchedURL: url, rssFeedLocations: data, @@ -148,11 +148,11 @@ class BraveTodayAddSourceViewController: UITableViewController { case .dataTaskError(let error as URLError) where error.code == .notConnectedToInternet: return error.localizedDescription case .dataTaskError: - return Strings.BraveToday.addSourceNetworkFailureMessage + return Strings.BraveNews.addSourceNetworkFailureMessage case .invalidData, .parserError: - return Strings.BraveToday.addSourceInvalidDataMessage + return Strings.BraveNews.addSourceInvalidDataMessage case .noFeedsFound: - return Strings.BraveToday.addSourceNoFeedsFoundMessage + return Strings.BraveNews.addSourceNoFeedsFoundMessage } } } @@ -188,13 +188,11 @@ class BraveTodayAddSourceViewController: UITableViewController { return } - if FeedDataSource.isOPMLParsingAvailable { - // Check if `data` is actually an OPML list - if let opml = OPMLParser.parse(data: data), !opml.outlines.isEmpty { - let locations = opml.outlines.compactMap(self.rssLocationFromOPMLOutline) - completion(locations.isEmpty ? .failure(.noFeedsFound) : .success(locations)) - return - } + // Check if `data` is actually an OPML list + if let opml = OPMLParser.parse(data: data), !opml.outlines.isEmpty { + let locations = opml.outlines.compactMap(self.rssLocationFromOPMLOutline) + completion(locations.isEmpty ? .failure(.noFeedsFound) : .success(locations)) + return } // Ensure page is reloaded to final landing page before looking for @@ -234,7 +232,7 @@ class BraveTodayAddSourceViewController: UITableViewController { private let textField = UITextField().then { $0.attributedPlaceholder = NSAttributedString( - string: Strings.BraveToday.searchTextFieldPlaceholder, + string: Strings.BraveNews.searchTextFieldPlaceholder, attributes: [.foregroundColor: UIColor.lightGray] ) $0.font = .preferredFont(forTextStyle: .body) @@ -285,7 +283,7 @@ class BraveTodayAddSourceViewController: UITableViewController { return cell case 1: let cell = tableView.dequeueReusableCell(for: indexPath) as CenteredButtonCell - cell.textLabel?.text = Strings.BraveToday.searchButtonTitle + cell.textLabel?.text = Strings.BraveNews.searchButtonTitle cell.tintColor = isSearchEnabled && !isLoading ? .braveOrange : .braveDisabled return cell default: @@ -293,7 +291,7 @@ class BraveTodayAddSourceViewController: UITableViewController { } case 1: let cell = tableView.dequeueReusableCell(for: indexPath) as CenteredButtonCell - cell.textLabel?.text = Strings.BraveToday.importOPML + cell.textLabel?.text = Strings.BraveNews.importOPML cell.tintColor = .braveOrange return cell default: @@ -302,7 +300,7 @@ class BraveTodayAddSourceViewController: UITableViewController { } override func numberOfSections(in tableView: UITableView) -> Int { - FeedDataSource.isOPMLParsingAvailable ? 2 : 1 + 2 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { @@ -314,7 +312,7 @@ class BraveTodayAddSourceViewController: UITableViewController { } } -extension BraveTodayAddSourceViewController: UIDocumentPickerDelegate { +extension BraveNewsAddSourceViewController: UIDocumentPickerDelegate { func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { guard let url = urls.first, url.isFileURL, let data = try? Data(contentsOf: url) else { controller.dismiss(animated: true) { @@ -338,7 +336,7 @@ extension BraveTodayAddSourceViewController: UIDocumentPickerDelegate { } return } - let resultsController = BraveTodayAddSourceResultsViewController( + let resultsController = BraveNewsAddSourceResultsViewController( dataSource: self.feedDataSource, searchedURL: url, rssFeedLocations: locations, @@ -353,7 +351,7 @@ extension BraveTodayAddSourceViewController: UIDocumentPickerDelegate { } } -extension BraveTodayAddSourceViewController: UITextFieldDelegate { +extension BraveNewsAddSourceViewController: UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { if isSearchEnabled { textField.resignFirstResponder() diff --git a/Client/Frontend/Settings/Brave Today/BraveTodayDebugSettingsController.swift b/Client/Frontend/Settings/Brave News/BraveNewsDebugSettingsController.swift similarity index 98% rename from Client/Frontend/Settings/Brave Today/BraveTodayDebugSettingsController.swift rename to Client/Frontend/Settings/Brave News/BraveNewsDebugSettingsController.swift index 484941135ba..ca68e7a77b3 100644 --- a/Client/Frontend/Settings/Brave Today/BraveTodayDebugSettingsController.swift +++ b/Client/Frontend/Settings/Brave News/BraveNewsDebugSettingsController.swift @@ -48,7 +48,7 @@ extension FeedDataSource { } } -class BraveTodayDebugSettingsController: TableViewController { +class BraveNewsDebugSettingsController: TableViewController { private let feedDataSource: FeedDataSource init(dataSource: FeedDataSource) { @@ -64,7 +64,7 @@ class BraveTodayDebugSettingsController: TableViewController { override func viewDidLoad() { super.viewDidLoad() - title = "Brave Today QA Settings" + title = "Brave News QA Settings" reloadData() diff --git a/Client/Frontend/Settings/Brave Today/BraveTodaySettingsViewController.swift b/Client/Frontend/Settings/Brave News/BraveNewsSettingsViewController.swift similarity index 78% rename from Client/Frontend/Settings/Brave Today/BraveTodaySettingsViewController.swift rename to Client/Frontend/Settings/Brave News/BraveNewsSettingsViewController.swift index bfccdac7bb1..a3d0bc5e8ef 100644 --- a/Client/Frontend/Settings/Brave Today/BraveTodaySettingsViewController.swift +++ b/Client/Frontend/Settings/Brave News/BraveNewsSettingsViewController.swift @@ -9,11 +9,11 @@ import Shared import BraveShared import Data -/// Displays relevant Brave Today settings such as toggling the feature on/off, and selecting sources +/// Displays relevant Brave News settings such as toggling the feature on/off, and selecting sources /// /// This controller may be presented in an isolated environment outside of the main settings pages from the -/// Brave Today header on the NTP -class BraveTodaySettingsViewController: TableViewController { +/// Brave News header on the NTP +class BraveNewsSettingsViewController: TableViewController { private let feedDataSource: FeedDataSource @@ -30,7 +30,7 @@ class BraveTodaySettingsViewController: TableViewController { override func viewDidLoad() { super.viewDidLoad() - title = Strings.BraveToday.braveToday + title = Strings.BraveNews.braveNews if navigationController?.viewControllers.first === self { // Isolated presentation, add close button @@ -41,22 +41,22 @@ class BraveTodaySettingsViewController: TableViewController { } private func reloadSections() { - // If a user hasn't opted in, they must do so before using Brave Today's features - if !Preferences.BraveToday.userOptedIn.value { + // If a user hasn't opted in, they must do so before using Brave News's features + if !Preferences.BraveNews.userOptedIn.value { dataSource.sections = [ .init( rows: [ .init( - text: Strings.BraveToday.braveToday, - detailText: Strings.BraveToday.introCardBody, + text: Strings.BraveNews.braveNews, + detailText: Strings.BraveNews.introCardBody, cellClass: MultilineSubtitleCell.self ), .init( - text: Strings.BraveToday.turnOnBraveToday, + text: Strings.BraveNews.turnOnBraveNews, selection: { [unowned self] in - Preferences.BraveToday.isShowingOptIn.value = false - Preferences.BraveToday.userOptedIn.value = true - Preferences.BraveToday.isEnabled.value = true + Preferences.BraveNews.isShowingOptIn.value = false + Preferences.BraveNews.userOptedIn.value = true + Preferences.BraveNews.isEnabled.value = true if self.feedDataSource.shouldLoadContent { self.feedDataSource.load() } @@ -73,13 +73,13 @@ class BraveTodaySettingsViewController: TableViewController { .init( rows: [ .boolRow( - title: Strings.BraveToday.isEnabledToggleLabel, - option: Preferences.BraveToday.isEnabled + title: Strings.BraveNews.isEnabledToggleLabel, + option: Preferences.BraveNews.isEnabled ) ] ), .init( - header: .title(Strings.BraveToday.yourSources), + header: .title(Strings.BraveNews.yourSources), rows: feedDataSource.rssFeedLocations.map { location in let enabled = self.feedDataSource.isRSSFeedEnabled(location) return Row( @@ -89,15 +89,15 @@ class BraveTodaySettingsViewController: TableViewController { self.feedDataSource.toggleRSSFeedEnabled(location, enabled: newValue) }), cellClass: SubtitleCell.self, - editActions: [.init(title: Strings.BraveToday.deleteUserSourceTitle, style: .destructive, selection: { [unowned self] indexPath in + editActions: [.init(title: Strings.BraveNews.deleteUserSourceTitle, style: .destructive, selection: { [unowned self] indexPath in guard let location = feedDataSource.rssFeedLocations[safe: indexPath.row] else { return } self.feedDataSource.removeRSSFeed(location) self.reloadSections() })] ) } + [ - Row(text: Strings.BraveToday.addSource, selection: { [unowned self] in - let controller = BraveTodayAddSourceViewController(dataSource: self.feedDataSource) + Row(text: Strings.BraveNews.addSource, selection: { [unowned self] in + let controller = BraveNewsAddSourceViewController(dataSource: self.feedDataSource) controller.sourcesAdded = { [weak self] _ in self?.reloadSections() } @@ -117,9 +117,9 @@ class BraveTodaySettingsViewController: TableViewController { if !feedDataSource.sources.isEmpty { dataSource.sections.append( .init( - header: .title(Strings.BraveToday.settingsSourceHeaderTitle), + header: .title(Strings.BraveNews.settingsSourceHeaderTitle), rows: [ - Row(text: Strings.BraveToday.allSources, selection: { [unowned self] in + Row(text: Strings.BraveNews.allSources, selection: { [unowned self] in let controller = FeedSourceListViewController(dataSource: self.feedDataSource, category: nil) self.navigationController?.pushViewController(controller, animated: true) }, accessory: .disclosureIndicator) @@ -128,7 +128,7 @@ class BraveTodaySettingsViewController: TableViewController { ) dataSource.sections.append( .init(rows: [ - Row(text: Strings.BraveToday.resetSourceSettingsButtonTitle, selection: { [unowned self] in + Row(text: Strings.BraveNews.resetSourceSettingsButtonTitle, selection: { [unowned self] in self.feedDataSource.resetSourcesToDefault() }, cellClass: ButtonCell.self) ]) diff --git a/Client/Frontend/Settings/BraveShieldsAndPrivacySettingsController.swift b/Client/Frontend/Settings/BraveShieldsAndPrivacySettingsController.swift index fa071f76e68..fe13d7cf75e 100644 --- a/Client/Frontend/Settings/BraveShieldsAndPrivacySettingsController.swift +++ b/Client/Frontend/Settings/BraveShieldsAndPrivacySettingsController.swift @@ -126,8 +126,8 @@ class BraveShieldsAndPrivacySettingsController: TableViewController { [(PlayListCacheClearable(), false), (PlayListDataClearable(), false)] - #if !NO_BRAVE_TODAY - alwaysVisible.append((BraveTodayClearable(feedDataSource: self.feedDataSource), true)) + #if !NO_BRAVE_NEWS + alwaysVisible.append((BraveNewsClearable(feedDataSource: self.feedDataSource), true)) #endif alwaysVisible.append(contentsOf: playlist) diff --git a/Client/Frontend/Settings/Clearables.swift b/Client/Frontend/Settings/Clearables.swift index 941b295b70e..a92886d3ad5 100644 --- a/Client/Frontend/Settings/Clearables.swift +++ b/Client/Frontend/Settings/Clearables.swift @@ -167,7 +167,7 @@ class DownloadsClearable: Clearable { } } -class BraveTodayClearable: Clearable { +class BraveNewsClearable: Clearable { let feedDataSource: FeedDataSource @@ -176,7 +176,7 @@ class BraveTodayClearable: Clearable { } var label: String { - return Strings.BraveToday.braveToday + return Strings.BraveNews.braveNews } func clear() -> Success { diff --git a/Client/Frontend/Settings/SettingsViewController.swift b/Client/Frontend/Settings/SettingsViewController.swift index 1a0e8d0bae1..435e545aede 100644 --- a/Client/Frontend/Settings/SettingsViewController.swift +++ b/Client/Frontend/Settings/SettingsViewController.swift @@ -92,8 +92,8 @@ class SettingsViewController: TableViewController { navigationController?.pushViewController(settings, animated: true) } - private func displayBraveTodayDebugMenu() { - let settings = BraveTodayDebugSettingsController(dataSource: feedDataSource) + private func displayBraveNewsDebugMenu() { + let settings = BraveNewsDebugSettingsController(dataSource: feedDataSource) navigationController?.pushViewController(settings, animated: true) } @@ -182,10 +182,10 @@ class SettingsViewController: TableViewController { ] } - #if !NO_BRAVE_TODAY + #if !NO_BRAVE_NEWS section.rows.append( - Row(text: Strings.BraveToday.braveToday, selection: { - let todaySettings = BraveTodaySettingsViewController(dataSource: self.feedDataSource) + Row(text: Strings.BraveNews.braveNews, selection: { + let todaySettings = BraveNewsSettingsViewController(dataSource: self.feedDataSource) self.navigationController?.pushViewController(todaySettings, animated: true) }, image: #imageLiteral(resourceName: "settings-brave-today").template, accessory: .disclosureIndicator) ) @@ -501,8 +501,8 @@ class SettingsViewController: TableViewController { Row(text: "View Rewards Debug Menu", selection: { [unowned self] in self.displayRewardsDebugMenu() }, accessory: .disclosureIndicator, cellClass: MultilineValue1Cell.self), - Row(text: "View Brave Today Debug Menu", selection: { [unowned self] in - self.displayBraveTodayDebugMenu() + Row(text: "View Brave News Debug Menu", selection: { [unowned self] in + self.displayBraveNewsDebugMenu() }, accessory: .disclosureIndicator, cellClass: MultilineValue1Cell.self), Row(text: "VPN Logs", selection: { [unowned self] in self.navigationController?.pushViewController(VPNLogsViewController(), animated: true) diff --git a/Client/Frontend/Share/AddFeedToBraveTodayActivity.swift b/Client/Frontend/Share/AddFeedToBraveNewsActivity.swift similarity index 88% rename from Client/Frontend/Share/AddFeedToBraveTodayActivity.swift rename to Client/Frontend/Share/AddFeedToBraveNewsActivity.swift index 4c6bc56d80e..6619bb27b4f 100644 --- a/Client/Frontend/Share/AddFeedToBraveTodayActivity.swift +++ b/Client/Frontend/Share/AddFeedToBraveNewsActivity.swift @@ -6,7 +6,7 @@ import Foundation import Shared -class AddFeedToBraveTodayActivity: UIActivity { +class AddFeedToBraveNewsActivity: UIActivity { fileprivate let callback: () -> Void init(callback: @escaping () -> Void) { @@ -14,7 +14,7 @@ class AddFeedToBraveTodayActivity: UIActivity { } override var activityTitle: String? { - return Strings.BraveToday.addSourceShareTitle + return Strings.BraveNews.addSourceShareTitle } override var activityImage: UIImage? {