From f80b5df3e9c2261512cf74c87ec5e2a389727a39 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Tue, 15 Mar 2022 15:13:46 -0700 Subject: [PATCH] hide progress bar on ios14. show refresh button oin ios14 --- .../App/Views/Home/HomeFeedViewIOS.swift | 26 ++++++++++++------- .../Sources/Views/FeedItem/GridCard.swift | 3 ++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 764ab3461..4c29dd93b 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -60,10 +60,14 @@ import Views ) .toolbar { ToolbarItem { - Button( - action: { viewModel.loadItems(dataService: dataService, searchQuery: searchQuery, isRefresh: true) }, - label: { Label("Refresh Feed", systemImage: "arrow.clockwise") } - ) + if viewModel.isLoading { + Button(action: {}, label: { ProgressView() }) + } else { + Button( + action: { viewModel.loadItems(dataService: dataService, searchQuery: searchQuery, isRefresh: true) }, + label: { Label("Refresh Feed", systemImage: "arrow.clockwise") } + ) + } } } } @@ -139,12 +143,14 @@ import Views } } } else { - Button( - action: { - viewModel.loadItems(dataService: dataService, searchQuery: searchQuery, isRefresh: true) - }, - label: { Label("Refresh Feed", systemImage: "arrow.clockwise") } - ) + if viewModel.isLoading { + Button(action: {}, label: { ProgressView() }) + } else { + Button( + action: { viewModel.loadItems(dataService: dataService, searchQuery: searchQuery, isRefresh: true) }, + label: { Label("Refresh Feed", systemImage: "arrow.clockwise") } + ) + } } } ToolbarItem { diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/GridCard.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/GridCard.swift index 30053fa59..e098badda 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/GridCard.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/GridCard.swift @@ -70,7 +70,8 @@ public struct GridCard: View { .tint(.appYellow48) .frame(maxWidth: .infinity, alignment: .leading) } else { - ProgressView(value: max(abs(item.readingProgress) / 100, 1)) + Color.clear + .contentShape(Rectangle()) .frame(maxWidth: .infinity, alignment: .leading) } #else