mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: video tabbar, settings icon
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:PiliPalaX/models/common/dynamics_type.dart';
|
|||||||
import 'package:PiliPalaX/models/common/reply_sort_type.dart';
|
import 'package:PiliPalaX/models/common/reply_sort_type.dart';
|
||||||
import 'package:PiliPalaX/pages/setting/widgets/select_dialog.dart';
|
import 'package:PiliPalaX/pages/setting/widgets/select_dialog.dart';
|
||||||
import 'package:PiliPalaX/utils/storage.dart';
|
import 'package:PiliPalaX/utils/storage.dart';
|
||||||
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
|
|
||||||
import '../home/index.dart';
|
import '../home/index.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
@@ -144,7 +145,17 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '空降助手',
|
title: '空降助手',
|
||||||
subTitle: '点击配置',
|
subTitle: '点击配置',
|
||||||
leading: Icon(Icons.block),
|
leading: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.shield),
|
||||||
|
Icon(
|
||||||
|
Icons.play_arrow_rounded,
|
||||||
|
size: 18,
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
setKey: SettingBoxKey.enableSponsorBlock,
|
setKey: SettingBoxKey.enableSponsorBlock,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
onTap: () => Get.toNamed('/sponsorBlock'),
|
onTap: () => Get.toNamed('/sponsorBlock'),
|
||||||
@@ -152,7 +163,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '检查未读动态',
|
title: '检查未读动态',
|
||||||
subTitle: '点击设置检查周期(min)',
|
subTitle: '点击设置检查周期(min)',
|
||||||
leading: Icon(Icons.notifications_none),
|
leading: const Icon(Icons.notifications_none),
|
||||||
setKey: SettingBoxKey.checkDynamic,
|
setKey: SettingBoxKey.checkDynamic,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
@@ -207,7 +218,11 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '使用gRPC加载评论',
|
title: '使用gRPC加载评论',
|
||||||
subTitle: '如无法加载评论,可关闭\n非gRPC楼中楼无法定位评论、按热度/时间排序、查看对话',
|
subTitle: '如无法加载评论,可关闭\n非gRPC楼中楼无法定位评论、按热度/时间排序、查看对话',
|
||||||
leading: Icon(Icons.reply),
|
leading: SizedBox(
|
||||||
|
height: 24,
|
||||||
|
width: 24,
|
||||||
|
child: Icon(MdiIcons.google, size: 20),
|
||||||
|
),
|
||||||
setKey: SettingBoxKey.grpcReply,
|
setKey: SettingBoxKey.grpcReply,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
@@ -218,44 +233,44 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
title: '显示视频分段信息',
|
title: '显示视频分段信息',
|
||||||
leading: Transform.rotate(
|
leading: Transform.rotate(
|
||||||
angle: pi / 2,
|
angle: pi / 2,
|
||||||
child: Icon(Icons.reorder),
|
child: Icon(MdiIcons.viewHeadline),
|
||||||
),
|
),
|
||||||
setKey: SettingBoxKey.showViewPoints,
|
setKey: SettingBoxKey.showViewPoints,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '视频页显示相关视频',
|
title: '视频页显示相关视频',
|
||||||
leading: Icon(Icons.recommend_outlined),
|
leading: Icon(MdiIcons.motionPlayOutline),
|
||||||
setKey: SettingBoxKey.showRelatedVideo,
|
setKey: SettingBoxKey.showRelatedVideo,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '显示视频评论',
|
title: '显示视频评论',
|
||||||
leading: Icon(Icons.reply_all),
|
leading: Icon(MdiIcons.commentTextOutline),
|
||||||
setKey: SettingBoxKey.showVideoReply,
|
setKey: SettingBoxKey.showVideoReply,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '显示番剧评论',
|
title: '显示番剧评论',
|
||||||
leading: Icon(Icons.reply_all),
|
leading: Icon(MdiIcons.commentTextOutline),
|
||||||
setKey: SettingBoxKey.showBangumiReply,
|
setKey: SettingBoxKey.showBangumiReply,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '默认展开视频简介',
|
title: '默认展开视频简介',
|
||||||
leading: Icon(Icons.expand_more),
|
leading: const Icon(Icons.expand_more),
|
||||||
setKey: SettingBoxKey.alwaysExapndIntroPanel,
|
setKey: SettingBoxKey.alwaysExapndIntroPanel,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '横屏自动展开视频简介',
|
title: '横屏自动展开视频简介',
|
||||||
leading: Icon(Icons.expand_more),
|
leading: const Icon(Icons.expand_more),
|
||||||
setKey: SettingBoxKey.exapndIntroPanelH,
|
setKey: SettingBoxKey.exapndIntroPanelH,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '横屏分P/合集列表显示在Tab栏',
|
title: '横屏分P/合集列表显示在Tab栏',
|
||||||
leading: Icon(Icons.format_list_numbered_rtl_sharp),
|
leading: const Icon(Icons.format_list_numbered_rtl_sharp),
|
||||||
setKey: SettingBoxKey.horizontalSeasonPanel,
|
setKey: SettingBoxKey.horizontalSeasonPanel,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1578,56 +1578,89 @@ class VideoDetailController extends GetxController
|
|||||||
child: FloatingActionButton(
|
child: FloatingActionButton(
|
||||||
tooltip: '提交',
|
tooltip: '提交',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Request()
|
showDialog(
|
||||||
.post(
|
context: context,
|
||||||
'${GStorage.blockServer}/api/skipSegments',
|
builder: (context) => AlertDialog(
|
||||||
queryParameters: {
|
title: const Text(
|
||||||
'videoID': bvid,
|
'确定无误再提交',
|
||||||
'cid': cid.value,
|
style: TextStyle(fontSize: 18),
|
||||||
'userID': GStorage.blockUserID,
|
),
|
||||||
'userAgent': Constants.userAgent,
|
actions: [
|
||||||
'videoDuration':
|
TextButton(
|
||||||
plPlayerController.durationSeconds.value,
|
onPressed: Get.back,
|
||||||
},
|
child: Text(
|
||||||
data: {
|
'取消',
|
||||||
'segments': list!
|
style: TextStyle(
|
||||||
.map(
|
color: Theme.of(context)
|
||||||
(item) => {
|
.colorScheme
|
||||||
'segment': [
|
.outline,
|
||||||
item.segment.first,
|
),
|
||||||
item.segment.second,
|
),
|
||||||
],
|
),
|
||||||
'category': item.category.name,
|
TextButton(
|
||||||
'actionType': item.actionType.name,
|
onPressed: () {
|
||||||
},
|
Get.back();
|
||||||
)
|
Request()
|
||||||
.toList(),
|
.post(
|
||||||
},
|
'${GStorage.blockServer}/api/skipSegments',
|
||||||
options: _options,
|
queryParameters: {
|
||||||
)
|
'videoID': bvid,
|
||||||
.then(
|
'cid': cid.value,
|
||||||
(res) {
|
'userID': GStorage.blockUserID,
|
||||||
if (res.statusCode == 200) {
|
'userAgent': Constants.userAgent,
|
||||||
Get.back();
|
'videoDuration': plPlayerController
|
||||||
SmartDialog.showToast('提交成功');
|
.durationSeconds.value,
|
||||||
list?.clear();
|
},
|
||||||
_handleSBData(res);
|
data: {
|
||||||
plPlayerController.segmentList.value =
|
'segments': list!
|
||||||
_segmentProgressList ?? <Segment>[];
|
.map(
|
||||||
if (positionSubscription == null) {
|
(item) => {
|
||||||
_initSkip();
|
'segment': [
|
||||||
}
|
item.segment.first,
|
||||||
} else {
|
item.segment.second,
|
||||||
SmartDialog.showToast(
|
],
|
||||||
'提交失败: ${{
|
'category':
|
||||||
400: '参数错误',
|
item.category.name,
|
||||||
403: '被自动审核机制拒绝',
|
'actionType':
|
||||||
429: '重复提交太快',
|
item.actionType.name,
|
||||||
409: '重复提交'
|
},
|
||||||
}[res.statusCode]}',
|
)
|
||||||
);
|
.toList(),
|
||||||
}
|
},
|
||||||
},
|
options: _options,
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(res) {
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
Get.back();
|
||||||
|
SmartDialog.showToast('提交成功');
|
||||||
|
list?.clear();
|
||||||
|
_handleSBData(res);
|
||||||
|
plPlayerController
|
||||||
|
.segmentList.value =
|
||||||
|
_segmentProgressList ??
|
||||||
|
<Segment>[];
|
||||||
|
if (positionSubscription ==
|
||||||
|
null) {
|
||||||
|
_initSkip();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SmartDialog.showToast(
|
||||||
|
'提交失败: ${{
|
||||||
|
400: '参数错误',
|
||||||
|
403: '被自动审核机制拒绝',
|
||||||
|
429: '重复提交太快',
|
||||||
|
409: '重复提交'
|
||||||
|
}[res.statusCode]}',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: const Text('确定提交'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Icon(Icons.check),
|
child: Icon(Icons.check),
|
||||||
|
|||||||
@@ -1256,7 +1256,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
const Spacer()
|
const Spacer()
|
||||||
else
|
else
|
||||||
Flexible(
|
Flexible(
|
||||||
flex: 1,
|
flex: length == 3 ? 2 : 1,
|
||||||
child: showReply ? Obx(() => tabbar()) : tabbar(),
|
child: showReply ? Obx(() => tabbar()) : tabbar(),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
|||||||
@@ -1760,10 +1760,16 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () => widget.videoDetailCtr?.onBlock(context),
|
onPressed: () => widget.videoDetailCtr?.onBlock(context),
|
||||||
icon: const Icon(
|
icon: Stack(
|
||||||
Icons.block,
|
alignment: Alignment.center,
|
||||||
size: 19,
|
children: [
|
||||||
color: Colors.white,
|
Icon(Icons.shield, size: 18),
|
||||||
|
Icon(
|
||||||
|
Icons.play_arrow_rounded,
|
||||||
|
size: 17,
|
||||||
|
color: Colors.black87,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import 'package:flutter_volume_controller/flutter_volume_controller.dart';
|
|||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
import 'package:media_kit/media_kit.dart';
|
import 'package:media_kit/media_kit.dart';
|
||||||
import 'package:media_kit_video/media_kit_video.dart';
|
import 'package:media_kit_video/media_kit_video.dart';
|
||||||
import 'package:PiliPalaX/plugin/pl_player/controller.dart';
|
import 'package:PiliPalaX/plugin/pl_player/controller.dart';
|
||||||
@@ -347,8 +348,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: ComBtn(
|
child: ComBtn(
|
||||||
icon: Transform.rotate(
|
icon: Transform.rotate(
|
||||||
angle: pi / 2,
|
angle: pi / 2,
|
||||||
child: const Icon(
|
child: Icon(
|
||||||
Icons.reorder,
|
MdiIcons.viewHeadline,
|
||||||
semanticLabel: '分段信息',
|
semanticLabel: '分段信息',
|
||||||
size: 22,
|
size: 22,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
|||||||
Reference in New Issue
Block a user