Skip to content

Commit

Permalink
🚀 v1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Jan 31, 2023
1 parent 718fbfc commit 4f2c4ec
Show file tree
Hide file tree
Showing 34 changed files with 155 additions and 116 deletions.
58 changes: 28 additions & 30 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,38 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="pika" />

<data
android:mimeType="*/*"
android:pathPattern=".*\\.pkz"
android:scheme="content" />
<data
android:mimeType="*/*"
android:pathPattern=".*\\.pkz"
android:scheme="file" />

<data
android:mimeType="*/*"
android:pathPattern=".*\\.pki"
android:scheme="content" />
<data
android:mimeType="*/*"
android:pathPattern=".*\\.pki"
android:scheme="file" />

<data
android:mimeType="*/*"
android:pathPattern=".*\\.zip"
android:scheme="content" />
<data
android:mimeType="*/*"
android:pathPattern=".*\\.zip"
android:scheme="file" />

</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.pkz" />
<data android:host="*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.pki" />
<data android:host="*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.zip" />
<data android:host="*" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
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.6.1
v1.6.4
9 changes: 5 additions & 4 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v1.6.2
v1.6.4

- [x] ♻️使用分流1和CDN-3分流进行直连
- [x] ♻️升级flutter
- [x] 🚀下载支持搜索
- [x] ✨️去掉UI动画的选项 (对阅读器友好)
- [x] ♻️去掉无用文件关联
- [x] ✨安卓支持 pika://comic/id 模式分享链接 (ios早已支持)
- [x] 🚀优化安卓配置文件
7 changes: 4 additions & 3 deletions lib/basic/Common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:uri_to_file/uri_to_file.dart';
import '../screens/ComicInfoScreen.dart';
import '../screens/DownloadOnlyImportScreen.dart';
import '../screens/PkzArchiveScreen.dart';
import 'config/IconLoading.dart';
import 'config/TimeOffsetHour.dart';

/// 默认的图片尺寸
Expand Down Expand Up @@ -304,22 +305,22 @@ StreamSubscription<String?> linkSubscript(BuildContext context) {
.first
.group(1)!;
Navigator.of(context).push(
MaterialPageRoute(
mixRoute(
builder: (BuildContext context) => ComicInfoScreen(comicId: comicId),
),
);
} else if (RegExp(r"^.*\.pkz$").allMatches(uri).isNotEmpty) {
File file = await toFile(uri);
Navigator.of(context).push(
MaterialPageRoute(
mixRoute(
builder: (BuildContext context) =>
PkzArchiveScreen(pkzPath: file.path),
),
);
} else if (RegExp(r"^.*\.((pki)|(zip))$").allMatches(uri).isNotEmpty) {
File file = await toFile(uri);
Navigator.of(context).push(
MaterialPageRoute(
mixRoute(
builder: (BuildContext context) =>
DownloadOnlyImportScreen(path: file.path),
),
Expand Down
5 changes: 3 additions & 2 deletions lib/basic/Navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:pikapika/basic/config/IconLoading.dart';

// 用于监听返回到当前页面的事件
// (await Navigator.push 会在子页面pushReplacement时结束阻塞)
Expand Down Expand Up @@ -37,12 +38,12 @@ Future<dynamic> navPushOrReplace(
if (_depth < _depthMax) {
return Navigator.push(
context,
MaterialPageRoute(builder: builder),
mixRoute(builder: builder),
);
} else {
return Navigator.pushReplacement(
context,
MaterialPageRoute(builder: builder),
mixRoute(builder: builder),
);
}
}
18 changes: 14 additions & 4 deletions lib/basic/config/IconLoading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const _propertyName = "iconLoading";
late bool _iconLoading;

Future<void> initIconLoading() async {
_iconLoading =
(await method.loadProperty(_propertyName, "false")) == "true";
_iconLoading = (await method.loadProperty(_propertyName, "false")) == "true";
}

bool currentIconLoading() {
Expand All @@ -19,7 +18,7 @@ bool currentIconLoading() {

Future<void> _chooseIconLoading(BuildContext context) async {
String? result =
await chooseListDialog<String>(context, "使用静态图标代替加载动画", ["是", "否"]);
await chooseListDialog<String>(context, "尽量减少UI动画", ["是", "否"]);
if (result != null) {
var target = result == "是";
await method.saveProperty(_propertyName, "$target");
Expand All @@ -31,7 +30,7 @@ Widget iconLoadingSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("使用静态图标代替加载动画"),
title: const Text("尽量减少UI动画"),
subtitle: Text(_iconLoading ? "是" : "否"),
onTap: () async {
await _chooseIconLoading(context);
Expand All @@ -41,3 +40,14 @@ Widget iconLoadingSetting() {
},
);
}

Route<T> mixRoute<T>({required WidgetBuilder builder}) {
if (currentIconLoading()) {
return PageRouteBuilder(
pageBuilder: (context, animation1, animation2) => builder.call(context),
transitionDuration: Duration.zero,
reverseTransitionDuration: Duration.zero,
);
}
return MaterialPageRoute(builder: builder);
}
13 changes: 7 additions & 6 deletions lib/screens/AccountScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:pikapika/screens/RegisterScreen.dart';
import 'package:pikapika/screens/SettingsScreen.dart';
import 'package:pikapika/screens/components/NetworkSetting.dart';

import '../basic/config/IconLoading.dart';
import '../basic/config/Version.dart';
import 'AppScreen.dart';
import 'DownloadListScreen.dart';
Expand Down Expand Up @@ -88,7 +89,7 @@ class _AccountScreenState extends State<AccountScreen> {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => const SettingsScreen(
hiddenAccountInfo: true,
),
Expand All @@ -101,7 +102,7 @@ class _AccountScreenState extends State<AccountScreen> {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => const AboutScreen(
),
),
Expand All @@ -114,7 +115,7 @@ class _AccountScreenState extends State<AccountScreen> {
if (androidNightModeDisplay) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const ThemeScreen()),
mixRoute(builder: (context) => const ThemeScreen()),
);
} else {
chooseLightTheme(context);
Expand Down Expand Up @@ -186,7 +187,7 @@ class _AccountScreenState extends State<AccountScreen> {
recognizer: TapGestureRecognizer()
..onTap = () => Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (BuildContext context) =>
const RegisterScreen()),
).then((value) => _loadProperties()),
Expand All @@ -209,7 +210,7 @@ class _AccountScreenState extends State<AccountScreen> {
await reloadIsPro();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const AppScreen()),
mixRoute(builder: (context) => const AppScreen()),
);
} catch (e, s) {
print("$e\n$s");
Expand Down Expand Up @@ -239,7 +240,7 @@ class _AccountScreenState extends State<AccountScreen> {
_toDownloadList() {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const DownloadListScreen()),
mixRoute(builder: (context) => const DownloadListScreen()),
);
}
}
13 changes: 7 additions & 6 deletions lib/screens/CategoriesScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:pikapika/screens/SearchScreen.dart';
import 'package:pikapika/screens/components/ContentError.dart';
import 'package:pikapika/basic/Method.dart';
import '../basic/config/CategoriesColumnCount.dart';
import '../basic/config/IconLoading.dart';
import 'ComicsScreen.dart';
import 'GamesScreen.dart';
import 'RandomComicsScreen.dart';
Expand All @@ -35,7 +36,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
if (value.isNotEmpty) {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => SearchScreen(keyword: value),
),
);
Expand Down Expand Up @@ -211,7 +212,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
() {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => const ComicCollectionsScreen(),
),
);
Expand Down Expand Up @@ -300,7 +301,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
() {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const RankingsScreen()),
mixRoute(builder: (context) => const RankingsScreen()),
);
},
);
Expand All @@ -312,7 +313,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
() {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const RandomComicsScreen()),
mixRoute(builder: (context) => const RandomComicsScreen()),
);
},
);
Expand All @@ -324,7 +325,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
() {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const GamesScreen()),
mixRoute(builder: (context) => const GamesScreen()),
);
},
);
Expand All @@ -335,7 +336,7 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
void _navigateToCategory(String? categoryTitle) {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => ComicsScreen(category: categoryTitle),
),
);
Expand Down
5 changes: 3 additions & 2 deletions lib/screens/ComicInfoScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:pikapika/screens/components/CommentMainType.dart';
import 'package:pikapika/screens/components/ItemBuilder.dart';
import 'package:pikapika/screens/components/Recommendation.dart';

import '../basic/config/IconLoading.dart';
import 'ComicReaderScreen.dart';
import 'DownloadConfirmScreen.dart';
import 'components/ComicDescriptionCard.dart';
Expand Down Expand Up @@ -285,7 +286,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
onPressed: () async {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => DownloadConfirmScreen(
comicInfo: _comicInfo,
epList: _epList.reversed.toList(),
Expand Down Expand Up @@ -356,7 +357,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
void _push(ComicInfo comicInfo, List<Ep> epList, int order, int? rank) {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => ComicReaderScreen(
comicInfo: comicInfo,
epList: epList,
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/ComicReaderScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:pikapika/basic/config/FullScreenUI.dart';
import 'package:pikapika/basic/config/Quality.dart';
import 'package:pikapika/screens/components/ContentError.dart';
import 'package:pikapika/screens/components/ContentLoading.dart';
import '../basic/config/IconLoading.dart';
import 'DownloadConfirmScreen.dart';
import 'components/ImageReader.dart';
import 'components/RightClickPop.dart';
Expand Down Expand Up @@ -86,7 +87,7 @@ class _ComicReaderScreenState extends State<ComicReaderScreen> {
if (orderMap.containsKey(epOrder)) {
_replacement = true;
Navigator.of(context).pushReplacement(
MaterialPageRoute(
mixRoute(
builder: (context) => ComicReaderScreen(
comicInfo: widget.comicInfo,
epList: widget.epList,
Expand All @@ -100,7 +101,7 @@ class _ComicReaderScreenState extends State<ComicReaderScreen> {

FutureOr<dynamic> _onReloadEp() {
_replacement = true;
Navigator.of(context).pushReplacement(MaterialPageRoute(
Navigator.of(context).pushReplacement(mixRoute(
builder: (context) => ComicReaderScreen(
comicInfo: widget.comicInfo,
epList: widget.epList,
Expand All @@ -115,7 +116,7 @@ class _ComicReaderScreenState extends State<ComicReaderScreen> {
FutureOr<dynamic> _onDownload() {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) => DownloadConfirmScreen(
comicInfo: widget.comicInfo,
epList: widget.epList.reversed.toList(),
Expand Down
5 changes: 3 additions & 2 deletions lib/screens/ComicsScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:pikapika/basic/store/Categories.dart';
import 'package:pikapika/basic/config/ListLayout.dart';
import 'package:pikapika/basic/Method.dart';
import '../basic/Entities.dart';
import '../basic/config/IconLoading.dart';
import 'SearchScreen.dart';
import 'components/ComicPager.dart';
import 'components/RightClickPop.dart';
Expand Down Expand Up @@ -41,7 +42,7 @@ class _ComicsScreenState extends State<ComicsScreen> {
if (value.isNotEmpty) {
Navigator.push(
context,
MaterialPageRoute(
mixRoute(
builder: (context) =>
SearchScreen(keyword: value, category: widget.category),
),
Expand Down Expand Up @@ -84,7 +85,7 @@ class _ComicsScreenState extends State<ComicsScreen> {
if (category == categoryTitle(null)) {
category = null;
}
Navigator.of(context).pushReplacement(MaterialPageRoute(
Navigator.of(context).pushReplacement(mixRoute(
builder: (context) {
return ComicsScreen(
category: category,
Expand Down
Loading

0 comments on commit 4f2c4ec

Please sign in to comment.