Skip to content

Commit

Permalink
fix: #341 #343 #339
Browse files Browse the repository at this point in the history
Signed-off-by: bggRGjQaUbCoE <[email protected]>
  • Loading branch information
bggRGjQaUbCoE committed Feb 28, 2025
1 parent 5c029c8 commit d2890d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/pages/setting/widgets/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ List<SettingsModel> get extraSettings => [
title: '使用可折叠的播放页面',
leading: Icon(Icons.video_settings),
setKey: SettingBoxKey.collapsibleVideoPage,
defaultVal: false,
defaultVal: true,
onChanged: (value) {
GStorage.collapsibleVideoPage = value;
},
Expand Down
24 changes: 15 additions & 9 deletions lib/pages/video/detail/view_v.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
StreamSubscription? _listenerDetail;
StreamSubscription? _listenerLoadingState;
StreamSubscription? _listenerCid;
StreamSubscription? _listenerFS;

Box get setting => GStorage.setting;

Expand Down Expand Up @@ -199,6 +200,15 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>

videoDetailController.animationController.addListener(animListener);

if (removeSafeArea) {
_listenerFS =
videoDetailController.plPlayerController.isFullScreen.listen((value) {
if (videoDetailController.direction.value == 'vertical') {
refreshPage();
}
});
}

WidgetsBinding.instance.addObserver(this);
}

Expand Down Expand Up @@ -374,6 +384,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
_listenerDetail?.cancel();
_listenerLoadingState?.cancel();
_listenerCid?.cancel();
_listenerFS?.cancel();

videoDetailController.skipTimer?.cancel();
videoDetailController.skipTimer = null;
Expand Down Expand Up @@ -691,6 +702,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
(BuildContext context, bool innerBoxIsScrolled) {
return [
SliverAppBar(
primary: false,
automaticallyImplyLeading: false,
pinned: true,
expandedHeight: isFullScreen ||
Expand Down Expand Up @@ -723,14 +735,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
showStatusBar();
}
}
if (removeSafeArea &&
isFullScreen &&
videoDetailController.direction.value ==
'vertical') {
WidgetsBinding.instance.addPostFrameCallback((_) {
refreshPage();
});
}
return Container(
color: Colors.black,
// showStatusBarBackgroundColor ? null : Colors.black,
Expand All @@ -742,7 +746,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
Orientation.landscape ||
removeSafeArea
? 0
: MediaQuery.of(context).padding.top)
: MediaQuery.of(this.context)
.padding
.top)
: videoDetailController.isExpanding ||
videoDetailController.isCollapsing
? animHeight
Expand Down

0 comments on commit d2890d7

Please sign in to comment.