fix(recommend): 精简底部信息并优化进度拖动
This commit is contained in:
1 parent
ccda41b15b
commit
d66ac8327e
16 files changed
+141
-163
No files matched your search
@@ -69,6 +69,7 @@ class PlayerPage extends StatefulWidget {
|
||||
this.showHomeFeedHeader = true,
|
||||
this.onDramaChanged,
|
||||
this.onImmersiveChanged,
|
||||
this.onScrubVisibilityChanged,
|
||||
this.onOpenFullPlayer,
|
||||
this.onRefreshFeed,
|
||||
this.onLoadMore,
|
||||
@@ -94,6 +95,7 @@ class PlayerPage extends StatefulWidget {
|
||||
final bool showHomeFeedHeader;
|
||||
final ValueChanged<Drama>? onDramaChanged;
|
||||
final ValueChanged<bool>? onImmersiveChanged;
|
||||
final ValueChanged<bool>? onScrubVisibilityChanged;
|
||||
final Future<void> Function(Drama drama, Episode episode)? onOpenFullPlayer;
|
||||
final Future<bool> Function()? onRefreshFeed;
|
||||
final Future<void> Function()? onLoadMore;
|
||||
@@ -114,6 +116,7 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
bool _chromeVisible = true;
|
||||
double _playbackSpeed = 1.0;
|
||||
bool _boosting = false;
|
||||
bool _scrubbing = false;
|
||||
double? _speedBeforeBoost;
|
||||
bool? _chromeBeforeBoost;
|
||||
|
||||
@@ -296,6 +299,12 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
unawaited(logic.setPlaybackSpeed(speed));
|
||||
}
|
||||
|
||||
void _setScrubbing(bool value) {
|
||||
if (_scrubbing == value) return;
|
||||
setState(() => _scrubbing = value);
|
||||
widget.onScrubVisibilityChanged?.call(value);
|
||||
}
|
||||
|
||||
/// 收藏状态确认后同步右侧计数(总数没有独立计数接口,按 ±1 跟随)。
|
||||
void _applyFavoriteDelta(String dramaId, {required bool nowSaved}) {
|
||||
setState(() {
|
||||
@@ -364,6 +373,7 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
content,
|
||||
if (widget.homeMode &&
|
||||
widget.showHomeFeedHeader &&
|
||||
!_scrubbing &&
|
||||
!_boosting &&
|
||||
!logic.pip &&
|
||||
!logic.pipPreparing)
|
||||
@@ -624,6 +634,7 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
onEpisodes: () => logic.showEpisodes(context),
|
||||
onMore: _openCurrentMore,
|
||||
onScrubStart: ready ? () => logic.beginScrub(videoPort!) : null,
|
||||
onScrubVisibilityChanged: _setScrubbing,
|
||||
onSeek: ready
|
||||
? (position) => logic.seekTo(context, videoPort!, position)
|
||||
: null,
|
||||
@@ -695,7 +706,7 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
? null
|
||||
: () => _openUnlockSheet(context, index, episode),
|
||||
),
|
||||
if (widget.homeMode && !_chromeVisible && !_boosting)
|
||||
if (widget.homeMode && !_chromeVisible && !_boosting && !_scrubbing)
|
||||
Positioned(
|
||||
right: 12,
|
||||
bottom: 56,
|
||||
@@ -706,6 +717,7 @@ class _PlayerPageState extends State<PlayerPage>
|
||||
),
|
||||
),
|
||||
if (widget.homeMode &&
|
||||
!_scrubbing &&
|
||||
!logic.chromeHidden &&
|
||||
selected &&
|
||||
!logic.session.userWantsPlay)
|
||||
|
||||
Reference in new issue
Block a user