mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -558,8 +558,8 @@ class _ArticlePageState extends CommonDynPageState<ArticlePage> {
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 14,
|
||||
bottom: padding.bottom + 14,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: padding.bottom + kFloatingActionButtonMargin,
|
||||
),
|
||||
child: replyButton,
|
||||
),
|
||||
@@ -602,8 +602,10 @@ class _ArticlePageState extends CommonDynPageState<ArticlePage> {
|
||||
|
||||
Widget btn = Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 14,
|
||||
bottom: 14 + (stats != null ? 0 : padding.bottom),
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom:
|
||||
kFloatingActionButtonMargin +
|
||||
(stats != null ? 0 : padding.bottom),
|
||||
),
|
||||
child: replyButton,
|
||||
);
|
||||
|
||||
@@ -198,8 +198,8 @@ class _DynamicDetailPageState extends CommonDynPageState<DynamicDetailPage> {
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 14,
|
||||
bottom: padding.bottom + 14,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: padding.bottom + kFloatingActionButtonMargin,
|
||||
),
|
||||
child: replyButton,
|
||||
),
|
||||
@@ -243,7 +243,10 @@ class _DynamicDetailPageState extends CommonDynPageState<DynamicDetailPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 14, bottom: 14),
|
||||
padding: const EdgeInsets.only(
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: kFloatingActionButtonMargin,
|
||||
),
|
||||
child: replyButton,
|
||||
),
|
||||
Container(
|
||||
|
||||
@@ -196,10 +196,10 @@ class _DynMentionPanelState
|
||||
),
|
||||
Obx(() {
|
||||
return Positioned(
|
||||
right: 16,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom:
|
||||
padding +
|
||||
16 +
|
||||
kFloatingActionButtonMargin +
|
||||
(_controller.showBtn.value ? viewInset : 0),
|
||||
child: AnimatedSlide(
|
||||
offset: _controller.showBtn.value
|
||||
|
||||
@@ -13,6 +13,9 @@ import 'package:PiliPlus/pages/fav_sort/view.dart';
|
||||
import 'package:PiliPlus/services/account_service.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/services.dart' show ValueChanged;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -85,7 +88,14 @@ class FavDetailController
|
||||
|
||||
AccountService accountService = Get.find<AccountService>();
|
||||
|
||||
late final RxBool isPlayAll = true.obs;
|
||||
late double dx = 0;
|
||||
late final RxBool isPlayAll = Pref.enablePlayAll.obs;
|
||||
|
||||
void setIsPlayAll(bool isPlayAll) {
|
||||
if (this.isPlayAll.value == isPlayAll) return;
|
||||
this.isPlayAll.value = isPlayAll;
|
||||
GStorage.setting.put(SettingBoxKey.enablePlayAll, isPlayAll);
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -58,7 +58,12 @@ class _FavDetailPageState extends State<FavDetailPage> with GridMixin {
|
||||
},
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
floatingActionButton: Obx(
|
||||
floatingActionButtonLocation: const CustomFabLocation(),
|
||||
floatingActionButton: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: kFloatingActionButtonMargin,
|
||||
),
|
||||
child: Obx(
|
||||
() => _favDetailController.folderInfo.value.mediaCount > 0
|
||||
? AnimatedSlide(
|
||||
offset: _favDetailController.isPlayAll.value
|
||||
@@ -66,15 +71,20 @@ class _FavDetailPageState extends State<FavDetailPage> with GridMixin {
|
||||
: const Offset(0.75, 0),
|
||||
duration: const Duration(milliseconds: 120),
|
||||
child: GestureDetector(
|
||||
onHorizontalDragUpdate: (details) =>
|
||||
_favDetailController.isPlayAll.value =
|
||||
details.delta.dx < 0,
|
||||
onHorizontalDragDown: (details) =>
|
||||
_favDetailController.dx =
|
||||
details.localPosition.dx,
|
||||
onHorizontalDragStart: (details) =>
|
||||
_favDetailController.setIsPlayAll(
|
||||
details.localPosition.dx <
|
||||
_favDetailController.dx,
|
||||
),
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
if (_favDetailController.isPlayAll.value) {
|
||||
_favDetailController.toViewPlayAll();
|
||||
} else {
|
||||
_favDetailController.isPlayAll.value = true;
|
||||
_favDetailController.setIsPlayAll(true);
|
||||
}
|
||||
},
|
||||
label: const Text('播放全部'),
|
||||
@@ -84,6 +94,7 @@ class _FavDetailPageState extends State<FavDetailPage> with GridMixin {
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
body: refreshIndicator(
|
||||
onRefresh: _favDetailController.onRefresh,
|
||||
child: CustomScrollView(
|
||||
@@ -509,3 +520,18 @@ class _FavDetailPageState extends State<FavDetailPage> with GridMixin {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class CustomFabLocation extends StandardFabLocation with FabFloatOffsetY {
|
||||
const CustomFabLocation();
|
||||
|
||||
@override
|
||||
double getOffsetX(
|
||||
ScaffoldPrelayoutGeometry scaffoldGeometry,
|
||||
double adjustment,
|
||||
) {
|
||||
return scaffoldGeometry.scaffoldSize.width -
|
||||
scaffoldGeometry.minInsets.right -
|
||||
scaffoldGeometry.floatingActionButtonSize.width +
|
||||
adjustment;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ class _FollowChildPageState extends State<FollowChildPage>
|
||||
children: [
|
||||
child,
|
||||
Positioned(
|
||||
right: 16 + padding.right,
|
||||
bottom: 16 + padding.bottom,
|
||||
right: kFloatingActionButtonMargin + padding.right,
|
||||
bottom: kFloatingActionButtonMargin + padding.bottom,
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () => _followController
|
||||
..orderType.value =
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import 'package:PiliPlus/models/common/later_view_type.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class LaterBaseController extends GetxController {
|
||||
@@ -9,5 +12,12 @@ class LaterBaseController extends GetxController {
|
||||
for (final item in LaterViewType.values) item: -1,
|
||||
}.obs;
|
||||
|
||||
late final RxBool isPlayAll = true.obs;
|
||||
late double dx = 0;
|
||||
late final RxBool isPlayAll = Pref.enablePlayAll.obs;
|
||||
|
||||
void setIsPlayAll(bool isPlayAll) {
|
||||
if (this.isPlayAll.value == isPlayAll) return;
|
||||
this.isPlayAll.value = isPlayAll;
|
||||
GStorage.setting.put(SettingBoxKey.enablePlayAll, isPlayAll);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/view_safe_area.dart';
|
||||
import 'package:PiliPlus/models/common/later_view_type.dart';
|
||||
import 'package:PiliPlus/models_new/later/data.dart';
|
||||
import 'package:PiliPlus/models_new/later/list.dart';
|
||||
import 'package:PiliPlus/pages/fav_detail/view.dart';
|
||||
import 'package:PiliPlus/pages/later/base_controller.dart';
|
||||
import 'package:PiliPlus/pages/later/controller.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
@@ -71,7 +72,12 @@ class _LaterPageState extends State<LaterPage>
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppbar(enableMultiSelect),
|
||||
floatingActionButton: Obx(
|
||||
floatingActionButtonLocation: const CustomFabLocation(),
|
||||
floatingActionButton: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: kFloatingActionButtonMargin,
|
||||
),
|
||||
child: Obx(
|
||||
() => currCtr().loadingState.value.isSuccess
|
||||
? AnimatedSlide(
|
||||
offset: _baseCtr.isPlayAll.value
|
||||
@@ -79,14 +85,18 @@ class _LaterPageState extends State<LaterPage>
|
||||
: const Offset(0.75, 0),
|
||||
duration: const Duration(milliseconds: 120),
|
||||
child: GestureDetector(
|
||||
onHorizontalDragUpdate: (details) =>
|
||||
_baseCtr.isPlayAll.value = details.delta.dx < 0,
|
||||
onHorizontalDragDown: (details) =>
|
||||
_baseCtr.dx = details.localPosition.dx,
|
||||
onHorizontalDragStart: (details) =>
|
||||
_baseCtr.setIsPlayAll(
|
||||
details.localPosition.dx < _baseCtr.dx,
|
||||
),
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
if (_baseCtr.isPlayAll.value) {
|
||||
currCtr().toViewPlayAll();
|
||||
} else {
|
||||
_baseCtr.isPlayAll.value = true;
|
||||
_baseCtr.setIsPlayAll(true);
|
||||
}
|
||||
},
|
||||
label: const Text('播放全部'),
|
||||
@@ -96,6 +106,7 @@ class _LaterPageState extends State<LaterPage>
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
body: ViewSafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
@@ -149,8 +149,8 @@ class _LiveDmBlockPageState extends State<LiveDmBlockPage> {
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 16 + padding.bottom,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: kFloatingActionButtonMargin + padding.bottom,
|
||||
child: FloatingActionButton(
|
||||
tooltip: '添加',
|
||||
onPressed: _addShieldKeyword,
|
||||
|
||||
@@ -66,8 +66,8 @@ class _MemberOpusState extends State<MemberOpus>
|
||||
),
|
||||
if (_controller.filter?.isNotEmpty == true)
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: bottom + 16,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: bottom + kFloatingActionButtonMargin,
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
|
||||
@@ -119,8 +119,8 @@ class _MemberVideoState extends State<MemberVideo>
|
||||
Obx(
|
||||
() => !_controller.isLocating.value
|
||||
? Positioned(
|
||||
right: 15 + padding.right,
|
||||
bottom: 15 + padding.bottom,
|
||||
right: kFloatingActionButtonMargin + padding.right,
|
||||
bottom: kFloatingActionButtonMargin + padding.bottom,
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
final fromViewAid = _controller.fromViewAid;
|
||||
|
||||
@@ -241,7 +241,10 @@ class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 14, bottom: 14),
|
||||
padding: const EdgeInsets.only(
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: kFloatingActionButtonMargin,
|
||||
),
|
||||
child: replyButton,
|
||||
),
|
||||
Container(
|
||||
@@ -335,8 +338,8 @@ class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 14,
|
||||
bottom: padding.bottom + 14,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: padding.bottom + kFloatingActionButtonMargin,
|
||||
),
|
||||
child: replyButton,
|
||||
),
|
||||
|
||||
@@ -101,8 +101,10 @@ class _PgcReviewPageState extends State<PgcReviewPage>
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 16,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom:
|
||||
MediaQuery.viewPaddingOf(context).bottom +
|
||||
kFloatingActionButtonMargin,
|
||||
child: FloatingActionButton(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
|
||||
@@ -276,8 +276,8 @@ class _PostPanelState extends State<PostPanel>
|
||||
children: [
|
||||
child,
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 16 + bottom,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: kFloatingActionButtonMargin + bottom,
|
||||
child: FloatingActionButton(
|
||||
tooltip: '提交',
|
||||
onPressed: () => showDialog(
|
||||
|
||||
@@ -143,8 +143,8 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
right: 14,
|
||||
bottom: 14 + bottom,
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: kFloatingActionButtonMargin + bottom,
|
||||
child: SlideTransition(
|
||||
position: _videoReplyController.anim,
|
||||
child: FloatingActionButton(
|
||||
|
||||
@@ -122,8 +122,9 @@ class _WebDavSettingPageState extends State<WebDavSettingPage> {
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
right: 16 + (showAppBar ? padding.right : 0),
|
||||
bottom: 16 + padding.bottom,
|
||||
right:
|
||||
kFloatingActionButtonMargin + (showAppBar ? padding.right : 0),
|
||||
bottom: kFloatingActionButtonMargin + padding.bottom,
|
||||
child: FloatingActionButton(
|
||||
child: const Icon(Icons.save),
|
||||
onPressed: () async {
|
||||
|
||||
@@ -140,7 +140,8 @@ abstract class SettingBoxKey {
|
||||
showFsScreenshotBtn = 'showFsScreenshotBtn',
|
||||
showFsLockBtn = 'showFsLockBtn',
|
||||
silentDownImg = 'silentDownImg',
|
||||
showMemberShop = 'showMemberShop';
|
||||
showMemberShop = 'showMemberShop',
|
||||
enablePlayAll = 'enablePlayAll';
|
||||
|
||||
static const String minimizeOnExit = 'minimizeOnExit',
|
||||
windowSize = 'windowSize',
|
||||
|
||||
@@ -855,4 +855,7 @@ abstract class Pref {
|
||||
static PlayRepeat get audioPlayMode =>
|
||||
PlayRepeat.values[_setting.get(SettingBoxKey.audioPlayMode) ??
|
||||
PlayRepeat.listOrder.index];
|
||||
|
||||
static bool get enablePlayAll =>
|
||||
_setting.get(SettingBoxKey.enablePlayAll, defaultValue: true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user