fix(player): 修正清屏态点击与滑动复位

This commit is contained in:
Zhou Weidong committed 2026-10-19 17:05:52 +08:00
1 parent a2de5e8eb7
commit aea130be11
2 files changed
+75 -32

No files matched your search

+17 -12
View File
@@ -128,6 +128,9 @@ class _PlayerPageState extends State<PlayerPage> with WidgetsBindingObserver {
itemCount: indices.length,
onPageChanged: (position) {
final index = indices[position];
if (widget.homeMode && !_feedChromeVisible) {
setState(() => _feedChromeVisible = true);
}
widget.onDramaChanged?.call(logic.queue.entryAt(index).drama);
unawaited(logic.selectEpisode(index));
},
@@ -444,17 +447,23 @@ class _PlayerPageState extends State<PlayerPage> with WidgetsBindingObserver {
child: GestureDetector(
key: const Key('home-feed-video-tap'),
behavior: HitTestBehavior.opaque,
onTap: () => setState(() => _feedChromeVisible = true),
onTap: () =>
logic.session.setUserWantsPlay(!logic.session.userWantsPlay),
),
),
if (widget.homeMode && !_feedChromeVisible)
Positioned(
top: 8,
right: 12,
child: ExitClearScreenButton(
key: const Key('home-feed-exit-clear-screen'),
tooltip: l10n.exitClearScreen,
onPressed: () => setState(() => _feedChromeVisible = true),
top: 0,
right: 0,
child: SafeArea(
left: false,
bottom: false,
minimum: const EdgeInsets.only(top: 8, right: 12),
child: ExitClearScreenButton(
key: const Key('home-feed-exit-clear-screen'),
tooltip: l10n.exitClearScreen,
onPressed: () => setState(() => _feedChromeVisible = true),
),
),
),
],
@@ -635,11 +644,7 @@ class _PlaybackOverlayState extends State<_PlaybackOverlay> {
bool _controlsVisible = true;
void _onVideoTap() {
if (!_controlsVisible) {
setState(() => _controlsVisible = true);
} else {
widget.onTogglePlay();
}
widget.onTogglePlay();
}
void _clearScreen() => setState(() => _controlsVisible = false);