Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue khcrysalis#113 replace the spinning indicator to percentage ind…
Browse files Browse the repository at this point in the history
…icator
ibharathkumarp committed Oct 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c7e8924 commit c18a067
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions iOS/Views/Sources/RepoViewController.swift
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ struct RepoViewController: View {
@State private var debounceWorkItem: DispatchWorkItem?
@State private var isVerifying: Bool = false
@State private var isSyncing: Bool = false
@State private var progress: Float = 0.0
@State var sources: [Source]?

private var footerText: String {
@@ -88,8 +89,14 @@ struct RepoViewController: View {
}
ToolbarItem(placement: .navigationBarTrailing) {
if isVerifying || isSyncing {
ProgressView()
.progressViewStyle(CircularProgressViewStyle())
ZStack {
ProgressView()
Text("\(Int((isVerifying ? progress : 0) * 100))%")
.foregroundColor(.secondary)
.font(.system(size: 12))
.multilineTextAlignment(.center)
}
.frame(width: 40, height: 40)
} else if validationStatus == .validJSON {
Button(String.localized("ADD")) {
CoreDataManager.shared.getSourceData(urlString: repoName) { error in
@@ -108,6 +115,7 @@ struct RepoViewController: View {
}
}


extension RepoViewController {
private func debounceRequest() {
isVerifying = true

0 comments on commit c18a067

Please sign in to comment.