Skip to content

Commit

Permalink
网络检查增加ProgressView()动画 (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Linecom233 authored Jul 16, 2024
1 parent c4b2d5d commit 238c9f9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
4 changes: 1 addition & 3 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,7 @@
}
},
"Feedback.continue-on-other-device" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"variations" : {
Expand Down Expand Up @@ -8647,9 +8648,6 @@
},
"圣马力诺 378" : {

},
"在App内反馈" : {

},
"在iPhone上继续" : {
"localizations" : {
Expand Down
21 changes: 1 addition & 20 deletions MeowBili/Errors/FeedbackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,7 @@ import SupportsUICore
struct FeedbackView: View {
@State var qrImage: CGImage?
var body: some View {
VStack {
if qrImage != nil {
Image(uiImage: UIImage(cgImage: qrImage!))
.resizable()
.frame(width: 100, height: 100)
Text("Feedback.continue-on-other-device")
.bold()
NavigationLink(destination: { InAppFeedbackView() }, label: {
Text("在App内反馈")
.bold()
.foregroundStyle(Color.blue)
})
.buttonStyle(.plain)
}
}
.onAppear {
if let image = EFQRCode.generate(for: "https://github.com/Darock-Studio/Darock-Bili/issues") {
qrImage = image
}
}
InAppFeedbackView()
}
}
#else
Expand Down
22 changes: 17 additions & 5 deletions MeowBili/Errors/NetwokFixView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ struct NetworkFixView: View {
}
}
} else {
Text("Troubleshoot.troubleshooting")
.bold()
HStack {
ProgressView()
Text("Troubleshoot.troubleshooting")
.bold()
}
}
} footer: {
if !(networkState == 3 && darockAPIState == 3 && bilibiliAPIState == 3) {
Expand All @@ -91,7 +94,10 @@ struct NetworkFixView: View {
if networkState == 0 {
Text("Troubleshoot.internet")
} else if networkState == 1 {
Text("Troubleshoot.internet.checking")
HStack {
ProgressView()
Text("Troubleshoot.internet.checking")
}
} else if networkState == 2 {
Text("Troubleshoot.internet.offline")
} else if networkState == 3 {
Expand All @@ -109,7 +115,10 @@ struct NetworkFixView: View {
Text("Troubleshoot.darock-api")
.foregroundStyle(networkState != 3 ? Color.secondary : .primary)
} else if darockAPIState == 1 {
Text("Troubleshoot.darock-api.checking")
HStack {
ProgressView()
Text("Troubleshoot.darock-api.checking")
}
} else if darockAPIState == 2 {
Text("Troubleshoot.darock-api.unavailable")
} else if darockAPIState == 3 {
Expand All @@ -130,7 +139,10 @@ struct NetworkFixView: View {
Text("Troubleshoot.bilibili-api")
.foregroundStyle(networkState != 3 ? Color.secondary : .primary)
} else if bilibiliAPIState == 1 {
Text("Troubleshoot.bilibili-api.checking")
HStack {
ProgressView()
Text("Troubleshoot.bilibili-api.checking")
}
} else if bilibiliAPIState == 2 {
Text("Troubleshoot.bilibili-api.unavailable")
} else if bilibiliAPIState == 3 {
Expand Down

0 comments on commit 238c9f9

Please sign in to comment.