Skip to content

Commit

Permalink
🚀 v1.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed May 8, 2023
1 parent 260aea0 commit e57be1a
Show file tree
Hide file tree
Showing 44 changed files with 513 additions and 301 deletions.
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ android {
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
debug {
applicationIdSuffix ".debug"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.7.3
v1.7.4
7 changes: 3 additions & 4 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
v1.7.3
- [x] ✨ 可以隐藏发电图标(设置项)
- [x] ✨ 可以给阅读器加灰度滤镜(设置项)(彩色墨水屏下或许有用)
- [x] ✨ 可以选择阅读器背景色(设置项)(白色可防止墨水屏下拖影)
v1.7.4
- [x] ♻️ 优化发电
- [x] ♻️ 优化设置
7 changes: 4 additions & 3 deletions lib/basic/config/CategoriesColumnCount.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ Widget categoriesColumnCountSetting() {
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text(
"首页分类列数",
"首页分类展示列数",
),
subtitle: Text("$categoriesColumnCount"),
subtitle:
Text(categoriesColumnCount == 0 ? "自动" : "$categoriesColumnCount"),
onTap: () async {
int? value = await chooseMapDialog(
context,
Expand All @@ -33,7 +34,7 @@ Widget categoriesColumnCountSetting() {
"4": 4,
"5": 5,
},
"选择首页分类列数");
"选择首页分类展示列数");
if (value != null) {
await method.saveProperty(_propertyName, "$value");
categoriesColumnCount = value;
Expand Down
28 changes: 28 additions & 0 deletions lib/basic/config/EBookScrolling.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import '../Method.dart';

const _propertyName = "eBookScrolling";

late bool _eBookScrolling;

bool get eBookScrolling => _eBookScrolling;

Future initEBookScrolling() async {
_eBookScrolling = (await method.loadProperty(_propertyName, "false")) == "true";
}

Widget eBookScrollingSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return SwitchListTile(
title: const Text("电子书模式滚动UI"),
value: _eBookScrolling,
onChanged: (value) async {
await method.saveProperty(_propertyName, "$value");
_eBookScrolling = value;
setState(() {});
},
);
},
);
}
37 changes: 37 additions & 0 deletions lib/basic/config/EBookScrollingRange.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';

import '../Method.dart';

const _propertyName = "eBookScrollingRange";

late int _eBookScrollingRange;

Future initEBookScrollingRange() async {
_eBookScrollingRange =
int.parse((await method.loadProperty(_propertyName, "80")));
}

double get eBookScrollingRange => _eBookScrollingRange / 100;

Widget eBookScrollingRangeSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: Text("电子书模式滚动UI - 滚动幅度 : $_eBookScrollingRange%屏幕高度"),
subtitle: Slider(
min: 30.toDouble(),
max: 80.toDouble(),
value: _eBookScrollingRange.toDouble(),
onChanged: (double value) async {
final va = value.toInt();
await method.loadProperty(_propertyName, "$va");
setState(() {
_eBookScrollingRange = va;
});
},
divisions: (80 - 30),
),
);
},
);
}
36 changes: 36 additions & 0 deletions lib/basic/config/EBookScrollingTrigger.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';

import '../Method.dart';

const _propertyName = "eBookScrollingTrigger";

late double _eBookScrollingTrigger;

Future initEBookScrollingTrigger() async {
_eBookScrollingTrigger =
double.parse((await method.loadProperty(_propertyName, "0.3")));
}

double get eBookScrollingTrigger => _eBookScrollingTrigger;

Widget eBookScrollingTriggerSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: Text("电子书模式滚动UI - 触发距离 : $_eBookScrollingTrigger 厘米"),
subtitle: Slider(
min: 0.1.toDouble(),
max: 2.0.toDouble(),
value: _eBookScrollingTrigger.toDouble(),
onChanged: (double value) async {
await method.saveProperty(_propertyName, "$value");
setState((){
_eBookScrollingTrigger = value;
});
},
divisions: (20 - 1),
),
);
},
);
}
1 change: 0 additions & 1 deletion lib/basic/config/HiddenFdIcon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Widget hiddenFdIconSetting() {
builder: (BuildContext context, void Function(void Function()) setState) {
return SwitchListTile(
title: const Text("隐藏个人空间的发电图标"),
subtitle: Text(_hiddenFdIcon ? "是" : "否"),
value: _hiddenFdIcon,
onChanged: (value) async {
await method.saveProperty(_propertyName, "$value");
Expand Down
1 change: 0 additions & 1 deletion lib/basic/config/IconLoading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Widget iconLoadingSetting() {
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("尽量减少UI动画"),
subtitle: Text(_iconLoading ? "是" : "否"),
onTap: () async {
await _chooseIconLoading(context);
setState(() {});
Expand Down
19 changes: 5 additions & 14 deletions lib/basic/config/UsingRightClickPop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,20 @@ bool currentUsingRightClickPop() {
return _usingRightClickPop;
}

Future<void> _chooseUsingRightClickPop(BuildContext context) async {
String? result =
await chooseListDialog<String>(context, "鼠标右键返回上一页", ["是", "否"]);
if (result != null) {
var target = result == "是";
await method.saveProperty(_propertyName, "$target");
_usingRightClickPop = target;
}
}

Widget usingRightClickPopSetting() {
if (!(Platform.isWindows || Platform.isMacOS || Platform.isLinux)) {
return Container();
}
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
return SwitchListTile(
title: const Text("鼠标右键返回上一页"),
subtitle: Text(_usingRightClickPop ? "是" : "否"),
onTap: () async {
await _chooseUsingRightClickPop(context);
onChanged: (value) async {
await method.saveProperty(_propertyName, "${value ? "是" : "否"}");
_usingRightClickPop = value;
setState(() {});
},
value: _usingRightClickPop,
);
},
);
Expand Down
3 changes: 1 addition & 2 deletions lib/basic/config/WillPopNotice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Widget willPopNoticeSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return SwitchListTile(
title: const Text("退出APP的提示"),
subtitle: Text(_willPopNotice ? "是" : "否"),
title: const Text("在首页连续按两下返回键才能退出APP"),
value: _willPopNotice,
onChanged: (value) async {
await method.saveProperty(_propertyName, "$value");
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/AboutScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:pikapika/basic/Cross.dart';
import 'package:pikapika/basic/config/Version.dart';
import 'package:pikapika/screens/components/Badge.dart';

import 'components/ListView.dart';
import 'components/RightClickPop.dart';

const _releasesUrl = "https://github.com/niuhuan/pikapika/releases";
Expand Down Expand Up @@ -54,7 +55,7 @@ class _AboutScreenState extends State<AboutScreen> {
appBar: AppBar(
title: const Text('关于'),
),
body: ListView(
body: PikaListView(
children: [
SizedBox(
width: min / 2,
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/AccountScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'AppScreen.dart';
import 'DownloadListScreen.dart';
import 'ForgotPasswordScreen.dart';
import 'components/ContentLoading.dart';
import 'components/ListView.dart';

// 账户设置
class AccountScreen extends StatefulWidget {
Expand Down Expand Up @@ -102,7 +103,7 @@ class _AccountScreenState extends State<AccountScreen> {
),
],
),
body: ListView(
body: PikaListView(
children: [
ListTile(
title: const Text("账号"),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/CategoriesScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'RandomComicsScreen.dart';
import 'components/Common.dart';
import 'components/ContentLoading.dart';
import 'components/Images.dart';
import 'components/ListView.dart';

// 分类
class CategoriesScreen extends StatefulWidget {
Expand Down Expand Up @@ -127,7 +128,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
if (snapshot.connectionState != ConnectionState.done) {
return const ContentLoading(label: '加载中');
}
return ListView(
return PikaListView(
children: [
Container(height: 20),
Wrap(
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/ComicInfoScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'components/CommentList.dart';
import 'components/ContentError.dart';
import 'components/ContentLoading.dart';
import 'components/ContinueReadButton.dart';
import 'components/ListView.dart';
import 'components/RightClickPop.dart';

// 漫画详情
Expand Down Expand Up @@ -146,7 +147,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
_buildDownloadAction(_epListFuture, _comicInfo),
],
),
body: ListView(
body: PikaListView(
children: [
ComicInfoCard(_comicInfo, linkItem: true),
ComicTagsCard(_comicInfo.tags),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/CommentScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:pikapika/screens/components/CommentItem.dart';
import 'package:pikapika/screens/components/CommentMainType.dart';
import 'package:pikapika/screens/components/ContentBuilder.dart';

import 'components/ListView.dart';
import 'components/RightClickPop.dart';

class _CommentChildPage extends e.Page {
Expand Down Expand Up @@ -67,7 +68,7 @@ class _CommentScreenState extends State<CommentScreen> {
successBuilder:
(BuildContext context, AsyncSnapshot<_CommentChildPage> snapshot) {
var page = snapshot.data!;
return ListView(
return PikaListView(
children: [
_buildPrePage(page),
...page.docs.map((e) => _buildComment(e)),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/DownloadConfirmScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:pikapika/screens/components/ContentLoading.dart';
import 'package:pikapika/basic/Method.dart';

import 'components/ComicInfoCard.dart';
import 'components/ListView.dart';
import 'components/RightClickPop.dart';

// 确认下载
Expand Down Expand Up @@ -128,7 +129,7 @@ class _DownloadConfirmScreenState extends State<DownloadConfirmScreen> {
if (snapshot.connectionState != ConnectionState.done) {
return const ContentLoading(label: '加载中');
}
return ListView(
return PikaListView(
children: [
ComicInfoCard(widget.comicInfo),
_buildButtons(),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/DownloadExportGroupScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../basic/config/IconLoading.dart';
import 'DownloadExportingGroupScreen.dart';
import 'components/ContentLoading.dart';
import 'components/DownloadInfoCard.dart';
import 'components/ListView.dart';

class DownloadExportGroupScreen extends StatefulWidget {
const DownloadExportGroupScreen({Key? key}) : super(key: key);
Expand Down Expand Up @@ -72,7 +73,7 @@ class _DownloadExportGroupScreenState extends State<DownloadExportGroupScreen> {
_f = method.allDownloads("");
});
},
child: ListView(
child: PikaListView(
children: ws,
),
),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/DownloadExportToFileScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '../basic/config/IsPro.dart';
import 'components/ContentError.dart';
import 'components/ContentLoading.dart';
import 'components/DownloadInfoCard.dart';
import 'components/ListView.dart';
import 'components/RightClickPop.dart';

// 导出
Expand Down Expand Up @@ -94,7 +95,7 @@ class _DownloadExportToFileScreenState
if (snapshot.connectionState != ConnectionState.done) {
return const ContentLoading(label: '加载中');
}
return ListView(
return PikaListView(
children: [
DownloadInfoCard(task: _task),
Container(
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/DownloadExportToSocketScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:pikapika/basic/Method.dart';
import 'components/ContentError.dart';
import 'components/ContentLoading.dart';
import 'components/DownloadInfoCard.dart';
import 'components/ListView.dart';
import 'components/RightClickPop.dart';

// 传输到其他设备
Expand Down Expand Up @@ -85,7 +86,7 @@ class _DownloadExportToSocketScreenState
if (snapshot.connectionState != ConnectionState.done) {
return const ContentLoading(label: '加载中');
}
return ListView(
return PikaListView(
children: [
DownloadInfoCard(task: widget.task),
Container(
Expand Down
7 changes: 2 additions & 5 deletions lib/screens/DownloadExportingGroupScreen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:pikapika/basic/Common.dart';

import '../basic/Channels.dart';
import '../basic/Cross.dart';
import '../basic/Method.dart';
import '../basic/config/ExportPath.dart';
import '../basic/config/ExportRename.dart';
import '../basic/config/IsPro.dart';
import 'components/ContentLoading.dart';
import 'components/ListView.dart';

class DownloadExportingGroupScreen extends StatefulWidget {
final List<String> idList;
Expand Down Expand Up @@ -57,7 +54,7 @@ class _DownloadExportingGroupScreenState
if (exported) {
return const Center(child: Text("导出成功"));
}
return ListView(
return PikaListView(
children: [
Container(height: 20),
displayExportPathInfo(),
Expand Down
Loading

0 comments on commit e57be1a

Please sign in to comment.