mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 16:48:16 +08:00
feat: add option to turn off dynamic interactions (#1798)
* add option to turn off dynamic interactions * update Signed-off-by: dom <githubaccount56556@proton.me> --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -170,6 +170,9 @@ class ItemModulesModel {
|
||||
ModuleBlocked? moduleBlocked;
|
||||
ModuleFold? moduleFold;
|
||||
|
||||
static bool showArgueMsg = Pref.showArgueMsg;
|
||||
static bool showDynInteraction = Pref.showDynInteraction;
|
||||
|
||||
ItemModulesModel.fromJson(Map<String, dynamic> json) {
|
||||
moduleAuthor = json['module_author'] != null
|
||||
? ModuleAuthorModel.fromJson(json['module_author'])
|
||||
@@ -186,12 +189,16 @@ class ItemModulesModel {
|
||||
moduleFold = json['module_fold'] != null
|
||||
? ModuleFold.fromJson(json['module_fold'])
|
||||
: null;
|
||||
moduleInteraction = json['module_interaction'] != null
|
||||
? ModuleInteraction.fromJson(json['module_interaction'])
|
||||
: null;
|
||||
moduleDispute = json['module_dispute'] != null
|
||||
? ModuleDispute.fromJson(json['module_dispute'])
|
||||
: null;
|
||||
if (showDynInteraction) {
|
||||
moduleInteraction = json['module_interaction'] != null
|
||||
? ModuleInteraction.fromJson(json['module_interaction'])
|
||||
: null;
|
||||
}
|
||||
if (showArgueMsg) {
|
||||
moduleDispute = json['module_dispute'] != null
|
||||
? ModuleDispute.fromJson(json['module_dispute'])
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
ItemModulesModel.fromOpusJson(List json) {
|
||||
|
||||
@@ -15,7 +15,8 @@ import 'package:PiliPlus/models/common/member/tab_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart';
|
||||
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart'
|
||||
show DynamicsDataModel, ItemModulesModel;
|
||||
import 'package:PiliPlus/pages/common/slide/common_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/home/controller.dart';
|
||||
import 'package:PiliPlus/pages/hot/controller.dart';
|
||||
@@ -404,11 +405,12 @@ List<SettingsModel> get extraSettings => [
|
||||
);
|
||||
},
|
||||
),
|
||||
const SwitchModel(
|
||||
SwitchModel(
|
||||
title: '显示视频警告/争议信息',
|
||||
leading: Icon(Icons.warning_amber_rounded),
|
||||
leading: const Icon(Icons.warning_amber_rounded),
|
||||
setKey: SettingBoxKey.showArgueMsg,
|
||||
defaultVal: true,
|
||||
onChanged: (val) => ItemModulesModel.showArgueMsg = val,
|
||||
),
|
||||
const SwitchModel(
|
||||
title: '分P/合集:倒序播放从首集开始播放',
|
||||
@@ -973,6 +975,14 @@ List<SettingsModel> get extraSettings => [
|
||||
}
|
||||
},
|
||||
),
|
||||
SwitchModel(
|
||||
title: '显示动态互动内容',
|
||||
subtitle: '开启后则在动态卡片底部显示互动内容(如关注的人点赞、热评等)',
|
||||
leading: const Icon(Icons.quickreply_outlined),
|
||||
setKey: SettingBoxKey.showDynInteraction,
|
||||
defaultVal: true,
|
||||
onChanged: (val) => ItemModulesModel.showDynInteraction = val,
|
||||
),
|
||||
NormalModel(
|
||||
title: '用户页默认展示TAB',
|
||||
leading: const Icon(Icons.tab),
|
||||
|
||||
@@ -57,6 +57,7 @@ abstract final class SettingBoxKey {
|
||||
defaultShowComment = 'defaultShowComment',
|
||||
replySortType = 'replySortType',
|
||||
defaultDynamicType = 'defaultDynamicType',
|
||||
showDynInteraction = 'showDynInteraction',
|
||||
enableHotKey = 'enableHotKey',
|
||||
enableSearchRcmd = 'enableSearchRcmd',
|
||||
enableQuickFav = 'enableQuickFav',
|
||||
|
||||
@@ -270,6 +270,9 @@ abstract final class Pref {
|
||||
static int get defaultDynamicType =>
|
||||
_setting.get(SettingBoxKey.defaultDynamicType, defaultValue: 0);
|
||||
|
||||
static bool get showDynInteraction =>
|
||||
_setting.get(SettingBoxKey.showDynInteraction, defaultValue: true);
|
||||
|
||||
static double get blockLimit =>
|
||||
_setting.get(SettingBoxKey.blockLimit, defaultValue: 0.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user