diff --git a/android/sample-app/src/main/java/cn/learningpad/oraltrainer/sample/ui/PlayerChrome.kt b/android/sample-app/src/main/java/cn/learningpad/oraltrainer/sample/ui/PlayerChrome.kt index 8e6705f..a3193ff 100644 --- a/android/sample-app/src/main/java/cn/learningpad/oraltrainer/sample/ui/PlayerChrome.kt +++ b/android/sample-app/src/main/java/cn/learningpad/oraltrainer/sample/ui/PlayerChrome.kt @@ -197,7 +197,9 @@ internal class PlayerChrome( } val topContent = LinearLayout(activity).apply { orientation = LinearLayout.VERTICAL - addView(bindings.lessonTitleText) + if (screenState.activeModule != Module.TRAIN) { + addView(bindings.lessonTitleText) + } if (screenState.activeModule == Module.TRAIN) { addView(createContinuousPlaybackRow(translucent)) } diff --git a/ios/OralTrainer/Views/FullscreenPlayerView.swift b/ios/OralTrainer/Views/FullscreenPlayerView.swift index 4ee8ff3..e4ab725 100644 --- a/ios/OralTrainer/Views/FullscreenPlayerView.swift +++ b/ios/OralTrainer/Views/FullscreenPlayerView.swift @@ -3,6 +3,7 @@ import SwiftUI /// 与安卓端横屏布局一致:全屏播放 + 半透明句面板 + 退出全屏按钮。 struct FullscreenPlayerView: View { @ObservedObject var controller: PlayerController + var showsLessonTitle: Bool = true let onExit: () -> Void @State private var subtitleVisible = true @@ -55,10 +56,12 @@ struct FullscreenPlayerView: View { Spacer() if subtitleVisible { VStack(alignment: .leading, spacing: 6) { - Text(controller.currentItem?.title ?? "未选择课程") - .font(.system(size: 17, weight: .bold)) - .foregroundColor(.white) - .lineLimit(1) + if showsLessonTitle { + Text(controller.currentItem?.title ?? "未选择课程") + .font(.system(size: 17, weight: .bold)) + .foregroundColor(.white) + .lineLimit(1) + } Text(sentenceMetaText) .font(.system(size: 13)) .foregroundColor(Theme.textOverlay) diff --git a/ios/OralTrainer/Views/PlayerSectionView.swift b/ios/OralTrainer/Views/PlayerSectionView.swift index ccf4af3..6a8746b 100644 --- a/ios/OralTrainer/Views/PlayerSectionView.swift +++ b/ios/OralTrainer/Views/PlayerSectionView.swift @@ -6,6 +6,7 @@ struct PlayerSectionView: View { var showsContinuousToggle: Bool @Binding var continuousPlayback: Bool var showsSubtitle: Binding? = .constant(true) + var showsLessonTitle: Bool = true var onFullscreen: () -> Void @State private var progressDragging = false @@ -74,10 +75,12 @@ struct PlayerSectionView: View { private var sentencePanel: some View { VStack(alignment: .leading, spacing: 6) { - Text(controller.currentItem?.title ?? "未选择课程") - .font(.system(size: 17, weight: .bold)) - .foregroundColor(.white) - .lineLimit(1) + if showsLessonTitle { + Text(controller.currentItem?.title ?? "未选择课程") + .font(.system(size: 17, weight: .bold)) + .foregroundColor(.white) + .lineLimit(1) + } if showsContinuousToggle { HStack(spacing: 0) { Text("连续播放") diff --git a/ios/OralTrainer/Views/RootView.swift b/ios/OralTrainer/Views/RootView.swift index 70f36e3..d79259b 100644 --- a/ios/OralTrainer/Views/RootView.swift +++ b/ios/OralTrainer/Views/RootView.swift @@ -113,7 +113,10 @@ struct RootView: View { syncCurrentCourse(with: videoHash) } .fullScreenCover(isPresented: $showFullscreenPlayer) { - FullscreenPlayerView(controller: controller) { + FullscreenPlayerView( + controller: controller, + showsLessonTitle: activeModule != .train + ) { exitFullscreen() } .onAppear { diff --git a/ios/OralTrainer/Views/TrainingView.swift b/ios/OralTrainer/Views/TrainingView.swift index c6d9f56..dc55b2d 100644 --- a/ios/OralTrainer/Views/TrainingView.swift +++ b/ios/OralTrainer/Views/TrainingView.swift @@ -13,6 +13,7 @@ struct TrainingView: View { controller: controller, showsContinuousToggle: true, continuousPlayback: $continuousPlayback, + showsLessonTitle: false, onFullscreen: onFullscreen ) CatalogView(vm: catalogVM)