add explain module
This commit is contained in:
@@ -6,6 +6,7 @@ struct FullscreenPlayerView: View {
|
||||
let onExit: () -> Void
|
||||
|
||||
@State private var subtitleVisible = true
|
||||
@State private var explanationSentence: SentenceBoundary?
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
@@ -38,10 +39,34 @@ struct FullscreenPlayerView: View {
|
||||
Text(sentenceMetaText)
|
||||
.font(.system(size: 13))
|
||||
.foregroundColor(Theme.textOverlay)
|
||||
Text(sentenceTextText)
|
||||
HStack(alignment: .center, spacing: 8) {
|
||||
Text(sentenceTextText)
|
||||
.font(.system(size: 15))
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(2)
|
||||
Spacer()
|
||||
Button {
|
||||
guard let sentence = controller.currentSentence,
|
||||
!(sentence.text ?? "").isEmpty else {
|
||||
return
|
||||
}
|
||||
controller.pause()
|
||||
explanationSentence = sentence
|
||||
} label: {
|
||||
Image(systemName: "lightbulb.circle.fill")
|
||||
.font(.system(size: 21, weight: .semibold))
|
||||
.foregroundColor(
|
||||
controller.currentSentence?.text?.isEmpty == false
|
||||
? Theme.accentLight
|
||||
: Theme.textSubtle
|
||||
)
|
||||
.frame(width: 30, height: 30)
|
||||
.background(Theme.overlay)
|
||||
.clipShape(Circle())
|
||||
.accessibilityLabel("AI 讲解这句话")
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
progressRow
|
||||
Text(statusText)
|
||||
.font(.system(size: 13))
|
||||
@@ -70,6 +95,12 @@ struct FullscreenPlayerView: View {
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
.sheet(item: $explanationSentence) { sentence in
|
||||
SentenceExplanationSheet(
|
||||
courseTitle: controller.currentItem?.title ?? "口语训练课程",
|
||||
sentence: sentence
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@State private var progressDragging = false
|
||||
|
||||
Reference in New Issue
Block a user