opt: v/b status

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-08 11:42:26 +08:00
parent dfd67219e3
commit 7cdfe26a26
4 changed files with 80 additions and 94 deletions

View File

@@ -126,14 +126,14 @@ class _StyleSettingState extends State<StyleSetting> {
style: subTitleStyle, style: subTitleStyle,
), ),
), ),
const SetSwitchItem( // const SetSwitchItem(
title: '播放页状态栏显示为背景色', // title: '播放页状态栏显示为背景色',
subTitle: '关闭则显示为黑色', // subTitle: '关闭则显示为黑色',
leading: Icon(Icons.border_outer_outlined), // leading: Icon(Icons.border_outer_outlined),
setKey: SettingBoxKey.videoPlayerShowStatusBarBackgroundColor, // setKey: SettingBoxKey.videoPlayerShowStatusBarBackgroundColor,
defaultVal: false, // defaultVal: false,
needReboot: true, // needReboot: true,
), // ),
const SetSwitchItem( const SetSwitchItem(
title: '播放页移除安全边距', title: '播放页移除安全边距',
subTitle: '隐藏状态栏、撑满屏幕,但播放控件仍处于安全域内', subTitle: '隐藏状态栏、撑满屏幕,但播放控件仍处于安全域内',

View File

@@ -81,7 +81,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
late bool autoPiP; late bool autoPiP;
late bool pipNoDanmaku; late bool pipNoDanmaku;
late bool removeSafeArea; late bool removeSafeArea;
late bool showStatusBarBackgroundColor; // late bool showStatusBarBackgroundColor;
final Floating floating = Floating(); final Floating floating = Floating();
// 生命周期监听 // 生命周期监听
// late final AppLifecycleListener _lifecycleListener; // late final AppLifecycleListener _lifecycleListener;
@@ -142,9 +142,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
setting.get(SettingBoxKey.enableVerticalExpand, defaultValue: false); setting.get(SettingBoxKey.enableVerticalExpand, defaultValue: false);
removeSafeArea = setting.get(SettingBoxKey.videoPlayerRemoveSafeArea, removeSafeArea = setting.get(SettingBoxKey.videoPlayerRemoveSafeArea,
defaultValue: false); defaultValue: false);
showStatusBarBackgroundColor = setting.get( // showStatusBarBackgroundColor = setting.get(
SettingBoxKey.videoPlayerShowStatusBarBackgroundColor, // SettingBoxKey.videoPlayerShowStatusBarBackgroundColor,
defaultValue: false); // defaultValue: false);
if (removeSafeArea) hideStatusBar(); if (removeSafeArea) hideStatusBar();
videoSourceInit(); videoSourceInit();
appbarStreamListen(); appbarStreamListen();
@@ -485,16 +485,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
appBar: removeSafeArea appBar: removeSafeArea
? null ? null
: AppBar( : AppBar(
backgroundColor: backgroundColor: Colors.black,
showStatusBarBackgroundColor ? null : Colors.black, // showStatusBarBackgroundColor ? null : Colors.black,
toolbarHeight: 0, toolbarHeight: 0,
systemOverlayStyle: SystemUiOverlayStyle( // systemOverlayStyle: SystemUiOverlayStyle(
statusBarIconBrightness: // statusBarIconBrightness:
Theme.of(context).brightness == Brightness.dark || // Theme.of(context).brightness == Brightness.dark ||
!showStatusBarBackgroundColor // !showStatusBarBackgroundColor
? Brightness.light // ? Brightness.light
: Brightness.dark, // : Brightness.dark,
systemNavigationBarColor: Colors.transparent), // systemNavigationBarColor: Colors.transparent,
// ),
), ),
body: Column( body: Column(
children: [ children: [
@@ -523,8 +524,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
if (!removeSafeArea) showStatusBar(); if (!removeSafeArea) showStatusBar();
} }
return Container( return Container(
color: color: Colors.black,
showStatusBarBackgroundColor ? null : Colors.black, // showStatusBarBackgroundColor ? null : Colors.black,
height: MediaQuery.of(context).orientation == height: MediaQuery.of(context).orientation ==
Orientation.landscape || Orientation.landscape ||
isFullScreen isFullScreen
@@ -825,16 +826,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
appBar: removeSafeArea appBar: removeSafeArea
? null ? null
: AppBar( : AppBar(
backgroundColor: backgroundColor: Colors.black,
showStatusBarBackgroundColor ? null : Colors.black, // showStatusBarBackgroundColor ? null : Colors.black,
toolbarHeight: 0, toolbarHeight: 0,
systemOverlayStyle: SystemUiOverlayStyle( // systemOverlayStyle: SystemUiOverlayStyle(
statusBarIconBrightness: // statusBarIconBrightness:
Theme.of(context).brightness == Brightness.dark || // Theme.of(context).brightness == Brightness.dark ||
!showStatusBarBackgroundColor // !showStatusBarBackgroundColor
? Brightness.light // ? Brightness.light
: Brightness.dark, // : Brightness.dark,
systemNavigationBarColor: Colors.transparent), // systemNavigationBarColor: Colors.transparent,
// ),
), ),
body: Container( body: Container(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
@@ -857,16 +859,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
appBar: removeSafeArea appBar: removeSafeArea
? null ? null
: AppBar( : AppBar(
backgroundColor: backgroundColor: Colors.black,
showStatusBarBackgroundColor ? null : Colors.black, // showStatusBarBackgroundColor ? null : Colors.black,
toolbarHeight: 0, toolbarHeight: 0,
systemOverlayStyle: SystemUiOverlayStyle( // systemOverlayStyle: SystemUiOverlayStyle(
statusBarIconBrightness: // statusBarIconBrightness:
Theme.of(context).brightness == Brightness.dark || // Theme.of(context).brightness == Brightness.dark ||
!showStatusBarBackgroundColor // !showStatusBarBackgroundColor
? Brightness.light // ? Brightness.light
: Brightness.dark, // : Brightness.dark,
systemNavigationBarColor: Colors.transparent), // systemNavigationBarColor: Colors.transparent,
// ),
), ),
body: Container( body: Container(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,

View File

@@ -842,48 +842,40 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
IgnorePointer( IgnorePointer(
ignoring: true, ignoring: true,
child: Align( child: Align(
alignment: Alignment.center,
child: Obx( child: Obx(
() => AnimatedOpacity( () => AnimatedOpacity(
curve: Curves.easeInOut, curve: Curves.easeInOut,
opacity: _volumeIndicator.value ? 1.0 : 0.0, opacity: _volumeIndicator.value ? 1.0 : 0.0,
duration: const Duration(milliseconds: 150), duration: const Duration(milliseconds: 150),
child: Container( child: Container(
alignment: Alignment.center, padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0x88000000), color: const Color(0x88000000),
borderRadius: BorderRadius.circular(64.0), borderRadius: BorderRadius.circular(64.0),
), ),
height: 34.0,
width: 70.0,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Icon(
height: 34.0, _volumeValue.value == 0.0
width: 28.0, ? Icons.volume_off
alignment: Alignment.centerRight, : _volumeValue.value < 0.5
child: Icon( ? Icons.volume_down
_volumeValue.value == 0.0 : Icons.volume_up,
? Icons.volume_off color: const Color(0xFFFFFFFF),
: _volumeValue.value < 0.5 size: 20.0,
? Icons.volume_down ),
: Icons.volume_up, const SizedBox(width: 2.0),
color: const Color(0xFFFFFFFF), Text(
size: 20.0, '${(_volumeValue.value * 100.0).round()}%',
style: const TextStyle(
fontSize: 13.0,
color: Color(0xFFFFFFFF),
), ),
), ),
Expanded(
child: Text(
'${(_volumeValue.value * 100.0).round()}%',
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 13.0,
color: Color(0xFFFFFFFF),
),
),
),
const SizedBox(width: 6.0),
], ],
), ),
), ),
@@ -896,49 +888,40 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
IgnorePointer( IgnorePointer(
ignoring: true, ignoring: true,
child: Align( child: Align(
alignment: Alignment.center,
child: Obx( child: Obx(
() => AnimatedOpacity( () => AnimatedOpacity(
curve: Curves.easeInOut, curve: Curves.easeInOut,
opacity: _brightnessIndicator.value ? 1.0 : 0.0, opacity: _brightnessIndicator.value ? 1.0 : 0.0,
duration: const Duration(milliseconds: 150), duration: const Duration(milliseconds: 150),
child: Container( child: Container(
alignment: Alignment.center, padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0x88000000), color: const Color(0x88000000),
borderRadius: BorderRadius.circular(64.0), borderRadius: BorderRadius.circular(64.0),
), ),
height: 34.0,
width: 70.0,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Icon(
height: 30.0, _brightnessValue.value < 1.0 / 3.0
width: 28.0, ? Icons.brightness_low
alignment: Alignment.centerRight, : _brightnessValue.value < 2.0 / 3.0
child: Icon( ? Icons.brightness_medium
_brightnessValue.value < 1.0 / 3.0 : Icons.brightness_high,
? Icons.brightness_low color: const Color(0xFFFFFFFF),
: _brightnessValue.value < 2.0 / 3.0 size: 18.0,
? Icons.brightness_medium
: Icons.brightness_high,
color: const Color(0xFFFFFFFF),
size: 18.0,
),
), ),
const SizedBox(width: 2.0), const SizedBox(width: 2.0),
Expanded( Text(
child: Text( '${(_brightnessValue.value * 100.0).round()}%',
'${(_brightnessValue.value * 100.0).round()}%', style: const TextStyle(
textAlign: TextAlign.center, fontSize: 13.0,
style: const TextStyle( color: Color(0xFFFFFFFF),
fontSize: 13.0,
color: Color(0xFFFFFFFF),
),
), ),
), ),
const SizedBox(width: 6.0),
], ],
), ),
), ),

View File

@@ -340,8 +340,8 @@ class SettingBoxKey {
displayMode = 'displayMode', displayMode = 'displayMode',
maxRowWidth = 'maxRowWidth', // 首页列最大宽度dp maxRowWidth = 'maxRowWidth', // 首页列最大宽度dp
videoPlayerRemoveSafeArea = 'videoPlayerRemoveSafeArea', // 视频播放器移除安全边距 videoPlayerRemoveSafeArea = 'videoPlayerRemoveSafeArea', // 视频播放器移除安全边距
videoPlayerShowStatusBarBackgroundColor = // videoPlayerShowStatusBarBackgroundColor =
'videoPlayerShowStatusBarBackgroundColor', // 播放页状态栏显示为背景色 // 'videoPlayerShowStatusBarBackgroundColor', // 播放页状态栏显示为背景色
dynamicsWaterfallFlow = 'dynamicsWaterfallFlow', // 动态瀑布流 dynamicsWaterfallFlow = 'dynamicsWaterfallFlow', // 动态瀑布流
upPanelPosition = 'upPanelPosition', // up主面板位置 upPanelPosition = 'upPanelPosition', // up主面板位置
dynamicsShowAllFollowedUp = 'dynamicsShowAllFollowedUp', // 动态显示全部关注up dynamicsShowAllFollowedUp = 'dynamicsShowAllFollowedUp', // 动态显示全部关注up