diff --git a/Multiplatform/Shared/AppAssets.swift b/Multiplatform/Shared/AppAssets.swift index 334948dd2..47fc26d7e 100644 --- a/Multiplatform/Shared/AppAssets.swift +++ b/Multiplatform/Shared/AppAssets.swift @@ -52,6 +52,18 @@ struct AppAssets { return Image(systemName: "plus") }() + static var articleExtractorError: Image = { + return Image("ArticleExtractorError") + }() + + static var articleExtractorOff: Image = { + return Image(systemName: "doc.plaintext") + }() + + static var articleExtractorOn: Image = { + return Image("ArticleExtractorOn") + }() + static var copyImage: Image = { return Image(systemName: "doc.on.doc") }() @@ -92,6 +104,14 @@ struct AppAssets { return Image(systemName: "info.circle") }() + static var nextArticleImage: Image = { + return Image(systemName: "chevron.down") + }() + + static var prevArticleImage: Image = { + return Image(systemName: "chevron.up") + }() + static var renameImage: Image = { return Image(systemName: "textformat") }() @@ -129,6 +149,14 @@ struct AppAssets { return Image(systemName: "safari") }() + static var readClosedImage: Image = { + return Image(systemName: "largecircle.fill.circle") + }() + + static var readOpenImage: Image = { + return Image(systemName: "circle") + }() + static var refreshImage: Image = { return Image(systemName: "arrow.clockwise") }() @@ -154,6 +182,14 @@ struct AppAssets { Image(systemName: "square.and.arrow.up") }() + static var starClosedImage: Image = { + return Image(systemName: "star.fill") + }() + + static var starOpenImage: Image = { + return Image(systemName: "star") + }() + static var smartFeedImage: RSImage = { #if os(macOS) return NSImage(systemSymbolName: "gear", accessibilityDescription: nil)! @@ -215,14 +251,6 @@ struct AppAssets { #endif }() - static var toggleStarred: Image = { - return Image(systemName: "star.fill") - }() - - static var toggleRead: Image = { - return Image(systemName: "largecircle.fill.circle") - }() - static var unreadFeedImage: IconImage { #if os(macOS) let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! diff --git a/Multiplatform/Shared/Article/ArticleContainerView.swift b/Multiplatform/Shared/Article/ArticleContainerView.swift index 8db0c6318..50f247015 100644 --- a/Multiplatform/Shared/Article/ArticleContainerView.swift +++ b/Multiplatform/Shared/Article/ArticleContainerView.swift @@ -17,6 +17,7 @@ struct ArticleContainerView: View { @ViewBuilder var body: some View { ArticleView() + .modifier(ArticleToolbarModifier()) .environmentObject(articleModel) .onAppear { sceneModel.articleModel = articleModel diff --git a/Multiplatform/Shared/Article/ArticleToolbarModifier.swift b/Multiplatform/Shared/Article/ArticleToolbarModifier.swift new file mode 100644 index 000000000..12bb4ae20 --- /dev/null +++ b/Multiplatform/Shared/Article/ArticleToolbarModifier.swift @@ -0,0 +1,93 @@ +// +// ArticleToolbarModifier.swift +// NetNewsWire +// +// Created by Maurice Parker on 7/5/20. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import SwiftUI + +struct ArticleToolbarModifier: ViewModifier { + + func body(content: Content) -> some View { + content + .toolbar { + #if os(iOS) + + ToolbarItem(placement: .navigation) { + HStack(spacing: 20) { + Button(action: { + }, label: { + AppAssets.prevArticleImage + .font(.title3) + }).help("Previouse Unread") + Button(action: { + }, label: { + AppAssets.nextArticleImage + .font(.title3) + }).help("Next Unread") + } + } + + ToolbarItem { + Button(action: { + }, label: { + AppAssets.readOpenImage + .font(.title3) + }).help("Mark as Unread") + } + + ToolbarItem { + Spacer() + } + + ToolbarItem { + Button(action: { + }, label: { + AppAssets.starOpenImage + .font(.title3) + }).help("Mark as Starred") + } + + ToolbarItem { + Spacer() + } + + ToolbarItem { + Button(action: { + }, label: { + AppAssets.nextUnreadArticleImage + .font(.title3) + }).help("Next Unread") + } + + ToolbarItem { + Spacer() + } + + ToolbarItem { + Button(action: { + }, label: { + AppAssets.articleExtractorOff + .font(.title3) + }).help("Reader View") + } + + ToolbarItem { + Spacer() + } + + ToolbarItem { + Button(action: { + }, label: { + AppAssets.shareImage + .font(.title3) + }).help("Share") + } + + #endif + } + } + +} diff --git a/Multiplatform/Shared/Assets.xcassets/ArticleExtractorError.imageset/ArticleExtractorError.pdf b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorError.imageset/ArticleExtractorError.pdf new file mode 100644 index 000000000..7d1450ec6 Binary files /dev/null and b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorError.imageset/ArticleExtractorError.pdf differ diff --git a/Multiplatform/Shared/Assets.xcassets/ArticleExtractorError.imageset/Contents.json b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorError.imageset/Contents.json new file mode 100644 index 000000000..0f8e6142c --- /dev/null +++ b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorError.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ArticleExtractorError.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/Multiplatform/Shared/Assets.xcassets/ArticleExtractorOn.symbolset/Contents.json b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorOn.symbolset/Contents.json new file mode 100644 index 000000000..842391314 --- /dev/null +++ b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorOn.symbolset/Contents.json @@ -0,0 +1,12 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "symbols" : [ + { + "filename" : "doc.plaintext.on.svg", + "idiom" : "universal" + } + ] +} diff --git a/Multiplatform/Shared/Assets.xcassets/ArticleExtractorOn.symbolset/doc.plaintext.on.svg b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorOn.symbolset/doc.plaintext.on.svg new file mode 100644 index 000000000..f0a3af753 --- /dev/null +++ b/Multiplatform/Shared/Assets.xcassets/ArticleExtractorOn.symbolset/doc.plaintext.on.svg @@ -0,0 +1,218 @@ + + + + Untitled + Created with Sketch. + + + + + + + Weight/Scale Variations + + + Ultralight + + + Thin + + + Light + + + Regular + + + Medium + + + Semibold + + + Bold + + + Heavy + + + Black + + + + + + + + + + + + + Design Variations + + + Symbols are supported in up to nine weights and three scales. + + + For optimal layout with text and other symbols, vertically align + + + symbols with the adjacent text. + + + + + + + + Margins + + + Leading and trailing margins on the left and right side of each symbol + + + can be adjusted by modifying the width of the blue rectangles. + + + Modifications are automatically applied proportionally to all + + + scales and weights. + + + + + + Exporting + + + Symbols should be outlined when exporting to ensure the + + + design is preserved when submitting to Xcode. + + + Template v.1.0 + + + Generated from doc.plaintext + + + Typeset at 100 points + + + Small + + + Medium + + + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Multiplatform/Shared/MainApp.swift b/Multiplatform/Shared/MainApp.swift index 1be5b3720..3e8200009 100644 --- a/Multiplatform/Shared/MainApp.swift +++ b/Multiplatform/Shared/MainApp.swift @@ -73,12 +73,12 @@ struct MainApp: App { ToolbarItem { Button(action: {}, label: { - AppAssets.toggleStarred + AppAssets.starOpenImage }).help("Mark as Starred") } ToolbarItem { Button(action: {}, label: { - AppAssets.toggleRead + AppAssets.readClosedImage }).help("Mark as Unread") } ToolbarItem { diff --git a/Multiplatform/Shared/Timeline/TimelineView.swift b/Multiplatform/Shared/Timeline/TimelineView.swift index 8711b1cf5..a1414408a 100644 --- a/Multiplatform/Shared/Timeline/TimelineView.swift +++ b/Multiplatform/Shared/Timeline/TimelineView.swift @@ -14,10 +14,12 @@ struct TimelineView: View { var body: some View { List(timelineModel.timelineItems) { timelineItem in - TimelineItemView(timelineItem: timelineItem) - .onAppear { - timelineModel.loadMoreTimelineItemsIfNecessary(timelineItem) - } + NavigationLink(destination: (ArticleContainerView(article: timelineItem.article))) { + TimelineItemView(timelineItem: timelineItem) + .onAppear { + timelineModel.loadMoreTimelineItemsIfNecessary(timelineItem) + } + } } } diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 094ee4a6a..71d0571f9 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -216,6 +216,8 @@ 517630232336657E00E15FFF /* WebViewProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517630222336657E00E15FFF /* WebViewProvider.swift */; }; 5177470324B2657F00EB0F74 /* TimeilneToolbarModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5177470224B2657F00EB0F74 /* TimeilneToolbarModifier.swift */; }; 5177470424B2657F00EB0F74 /* TimeilneToolbarModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5177470224B2657F00EB0F74 /* TimeilneToolbarModifier.swift */; }; + 5177470624B2910300EB0F74 /* ArticleToolbarModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5177470524B2910300EB0F74 /* ArticleToolbarModifier.swift */; }; + 5177470724B2910300EB0F74 /* ArticleToolbarModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5177470524B2910300EB0F74 /* ArticleToolbarModifier.swift */; }; 517A745B2443665000B553B9 /* UIPageViewController-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517A745A2443665000B553B9 /* UIPageViewController-Extensions.swift */; }; 517A757724451BFC00B553B9 /* OAuthSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 517A755524451BD500B553B9 /* OAuthSwift.framework */; }; 517A757824451BFC00B553B9 /* OAuthSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 517A755524451BD500B553B9 /* OAuthSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -1862,6 +1864,7 @@ 517630032336215100E15FFF /* main.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = ""; }; 517630222336657E00E15FFF /* WebViewProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewProvider.swift; sourceTree = ""; }; 5177470224B2657F00EB0F74 /* TimeilneToolbarModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeilneToolbarModifier.swift; sourceTree = ""; }; + 5177470524B2910300EB0F74 /* ArticleToolbarModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleToolbarModifier.swift; sourceTree = ""; }; 517A745A2443665000B553B9 /* UIPageViewController-Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIPageViewController-Extensions.swift"; sourceTree = ""; }; 517A754424451BD500B553B9 /* OAuthSwift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OAuthSwift.xcodeproj; path = submodules/OAuthSwift/OAuthSwift.xcodeproj; sourceTree = ""; }; 5181C5AC24AF89B1002E0F70 /* PreferredColorSchemeModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferredColorSchemeModifier.swift; sourceTree = ""; }; @@ -2740,6 +2743,7 @@ children = ( 51A5769524AE617200078888 /* ArticleContainerView.swift */, 51A576BA24AE621800078888 /* ArticleModel.swift */, + 5177470524B2910300EB0F74 /* ArticleToolbarModifier.swift */, 51A576BD24AE637400078888 /* ArticleView.swift */, ); path = Article; @@ -4843,6 +4847,7 @@ 514E6C0924AD39AD00AC6F6E /* ArticleIconImageLoader.swift in Sources */, 6594CA3B24AF6F2A005C7D7C /* OPMLExporter.swift in Sources */, FA80C13E24B072AA00974098 /* AddFolderModel.swift in Sources */, + 5177470624B2910300EB0F74 /* ArticleToolbarModifier.swift in Sources */, 51919FAF24AA8EFA00541E64 /* SidebarItemView.swift in Sources */, 514E6BDA24ACEA0400AC6F6E /* TimelineItemView.swift in Sources */, FA80C11724B0728000974098 /* AddFolderView.swift in Sources */, @@ -4952,6 +4957,7 @@ 51919FB024AA8EFA00541E64 /* SidebarItemView.swift in Sources */, 51919FEF24AB85E400541E64 /* TimelineContainerView.swift in Sources */, 51E4996624A8760B00B667CB /* ArticleStyle.swift in Sources */, + 5177470724B2910300EB0F74 /* ArticleToolbarModifier.swift in Sources */, FA80C11824B0728000974098 /* AddFolderView.swift in Sources */, 51E4996C24A8762D00B667CB /* ExtractedArticle.swift in Sources */, 51E4990824A808C300B667CB /* RSHTMLMetadata+Extension.swift in Sources */,