From 39cfba7497acc6f6400c50f709d9acdfba1ecfeb Mon Sep 17 00:00:00 2001 From: Marco Gomiero Date: Tue, 24 Oct 2023 21:35:39 +0200 Subject: [PATCH] Improve iOS design on feed list --- iosApp/Source/App/CompactView.swift | 2 +- iosApp/Source/App/Drawer/SidebarDrawer.swift | 2 +- iosApp/Source/App/RegularView.swift | 2 +- .../Source/Settings/About/AboutScreen.swift | 2 +- .../Settings/About/LicensesScreen.swift | 2 +- .../Settings/Feeds/FeedSourceListScreen.swift | 79 ++++++++++--------- .../ImportExport/ImportExportScreen.swift | 2 +- .../ImportExportSheetToShow.swift | 2 +- iosApp/Source/UI/Components/HtmlView.swift | 2 +- 9 files changed, 49 insertions(+), 46 deletions(-) diff --git a/iosApp/Source/App/CompactView.swift b/iosApp/Source/App/CompactView.swift index 3591376a..9f1c64cf 100644 --- a/iosApp/Source/App/CompactView.swift +++ b/iosApp/Source/App/CompactView.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 21/10/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import Foundation diff --git a/iosApp/Source/App/Drawer/SidebarDrawer.swift b/iosApp/Source/App/Drawer/SidebarDrawer.swift index 3b39ed52..433cbc12 100644 --- a/iosApp/Source/App/Drawer/SidebarDrawer.swift +++ b/iosApp/Source/App/Drawer/SidebarDrawer.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 21/10/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import SwiftUI diff --git a/iosApp/Source/App/RegularView.swift b/iosApp/Source/App/RegularView.swift index 542937c8..22d54458 100644 --- a/iosApp/Source/App/RegularView.swift +++ b/iosApp/Source/App/RegularView.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 21/10/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import Foundation diff --git a/iosApp/Source/Settings/About/AboutScreen.swift b/iosApp/Source/Settings/About/AboutScreen.swift index 3f78fe27..90cc3f3d 100644 --- a/iosApp/Source/Settings/About/AboutScreen.swift +++ b/iosApp/Source/Settings/About/AboutScreen.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 22/07/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import Foundation diff --git a/iosApp/Source/Settings/About/LicensesScreen.swift b/iosApp/Source/Settings/About/LicensesScreen.swift index 548bc452..c8a02b9a 100644 --- a/iosApp/Source/Settings/About/LicensesScreen.swift +++ b/iosApp/Source/Settings/About/LicensesScreen.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 22/07/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import SwiftUI diff --git a/iosApp/Source/Settings/Feeds/FeedSourceListScreen.swift b/iosApp/Source/Settings/Feeds/FeedSourceListScreen.swift index e9502c41..75674626 100644 --- a/iosApp/Source/Settings/Feeds/FeedSourceListScreen.swift +++ b/iosApp/Source/Settings/Feeds/FeedSourceListScreen.swift @@ -51,54 +51,57 @@ private struct FeedSourceListContent: View { VStack { if feedState.isEmpty { VStack { + Spacer() + Text(localizer.no_feeds_found_message.localized) .font(.body) NavigationLink(value: SheetPage.addFeed) { Text(localizer.add_feed.localized) } + + Spacer() } } else { List { ForEach(feedState, id: \.self.categoryId) { feedSourceState in + DisclosureGroup( + content: { + ForEach(feedSourceState.feedSources, id: \.self.id) { feedSource in + VStack(alignment: .leading) { + Text(feedSource.title) + .font(.system(size: 16)) + .padding(.top, Spacing.regular) + .padding(.bottom, 2) + + Text(feedSource.url) + .font(.system(size: 12)) + .padding(.top, 0) + .padding(.bottom, Spacing.regular) - Section { - ForEach(feedSourceState.feedSources, id: \.self.id) { feedSource in - VStack(alignment: .leading) { - Text(feedSource.title) - .font(.system(size: 16)) - .padding(.top, Spacing.regular) - .padding(.bottom, 2) - - Text(feedSource.url) - .font(.system(size: 12)) - .padding(.top, 0) - .padding(.bottom, Spacing.regular) - - } - .padding(.horizontal, Spacing.small) - .id(feedSource.id) - .contextMenu { - Button { - deleteFeedSource(feedSource) - } label: { - Label( - localizer.delete_feed.localized, - systemImage: "trash" - ) + } + .padding(.horizontal, Spacing.small) + .id(feedSource.id) + .contextMenu { + Button { + deleteFeedSource(feedSource) + } label: { + Label( + localizer.delete_feed.localized, + systemImage: "trash" + ) + } } } + }, + label: { + Text(feedSourceState.categoryName ?? localizer.no_category.localized) + .font(.system(size: 16)) + .foregroundStyle(Color(UIColor.label)) + .bold() + .padding(Spacing.regular) } - - } header: { - Text(feedSourceState.categoryName ?? localizer.no_category.localized) - .font(.system(size: 16)) - .foregroundStyle(Color(UIColor.label)) - .bold() - .padding(.horizontal, Spacing.small) - - } - .textCase(nil) + ) .listRowInsets( EdgeInsets( top: .zero, @@ -108,15 +111,15 @@ private struct FeedSourceListContent: View { ) } } - - .listStyle(.sidebar) - .scrollContentBackground(.hidden) - + .padding(.top, -Spacing.medium) .sheet(isPresented: $showAddFeed) { AddFeedScreen() } } + + Spacer() } + .scrollContentBackground(.hidden) .toolbar { ToolbarItem(placement: .navigationBarLeading) { Button( diff --git a/iosApp/Source/Settings/ImportExport/ImportExportScreen.swift b/iosApp/Source/Settings/ImportExport/ImportExportScreen.swift index ea896799..66632872 100644 --- a/iosApp/Source/Settings/ImportExport/ImportExportScreen.swift +++ b/iosApp/Source/Settings/ImportExport/ImportExportScreen.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 01/09/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import SwiftUI diff --git a/iosApp/Source/Settings/ImportExport/ImportExportSheetToShow.swift b/iosApp/Source/Settings/ImportExport/ImportExportSheetToShow.swift index 1a7fef8f..2bc070e4 100644 --- a/iosApp/Source/Settings/ImportExport/ImportExportSheetToShow.swift +++ b/iosApp/Source/Settings/ImportExport/ImportExportSheetToShow.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 01/09/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import Foundation diff --git a/iosApp/Source/UI/Components/HtmlView.swift b/iosApp/Source/UI/Components/HtmlView.swift index 5adcc472..1aea4189 100644 --- a/iosApp/Source/UI/Components/HtmlView.swift +++ b/iosApp/Source/UI/Components/HtmlView.swift @@ -3,7 +3,7 @@ // FeedFlow // // Created by Marco Gomiero on 22/07/23. -// Copyright © 2023 orgName. All rights reserved. +// Copyright © 2023 FeedFlow. All rights reserved. // import WebKit