Padding slider iphone edge

This commit is contained in:
niuhuan 2022-07-04 10:02:09 +08:00
parent ad3964159c
commit ec96f238d9
7 changed files with 90 additions and 34 deletions

View File

@ -53,6 +53,8 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pika" />
<data
android:mimeType="*/*"
android:pathPattern=".*\\.pkz"

View File

@ -2,6 +2,15 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>pika</string>
</array>
</dict>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
@ -23,35 +32,35 @@
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>niuhuan.pkz</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
<string>com.apple.package</string>
</array>
<key>UTTypeDescription</key>
<string>PKZ Archive</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>pkz</string>
<string>pki</string>
<string>zip</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/vnd.niuhuan.pkz</string>
<string>text/vnd.niuhuan.pki</string>
<string>text/vnd.niuhuan.zip</string>
</array>
</dict>
</dict>
</array>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>niuhuan.pkz</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
<string>com.apple.package</string>
</array>
<key>UTTypeDescription</key>
<string>PKZ Archive</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>pkz</string>
<string>pki</string>
<string>zip</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/vnd.niuhuan.pkz</string>
<string>text/vnd.niuhuan.pki</string>
<string>text/vnd.niuhuan.zip</string>
</array>
</dict>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>

View File

@ -6,6 +6,7 @@ import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:uni_links/uni_links.dart';
import 'package:uri_to_file/uri_to_file.dart';
import '../screens/ComicInfoScreen.dart';
import '../screens/DownloadOnlyImportScreen.dart';
import '../screens/PkzArchiveScreen.dart';
import 'config/TimeOffsetHour.dart';
@ -297,7 +298,17 @@ Future<String?> inputString(BuildContext context, String title,
StreamSubscription<String?> linkSubscript(BuildContext context) {
return linkStream.listen((uri) async {
if (uri == null) return;
if (RegExp(r"^.*\.pkz$").allMatches(uri).isNotEmpty) {
if (RegExp(r"^pika://comic/([0-9A-z]+)/$").allMatches(uri).isNotEmpty) {
String comicId = RegExp(r"^pika://comic/([0-9A-z]+)/$")
.allMatches(uri)
.first
.group(1)!;
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => ComicInfoScreen(comicId: comicId),
),
);
} else if (RegExp(r"^.*\.pkz$").allMatches(uri).isNotEmpty) {
File file = await toFile(uri);
Navigator.of(context).push(
MaterialPageRoute(

View File

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:pikapika/basic/Common.dart';
import 'package:pikapika/basic/Cross.dart';
@ -23,8 +25,10 @@ import 'components/RightClickPop.dart';
//
class ComicInfoScreen extends StatefulWidget {
final String comicId;
final bool holdPkz;
const ComicInfoScreen({Key? key, required this.comicId}) : super(key: key);
const ComicInfoScreen({Key? key, required this.comicId, this.holdPkz = false})
: super(key: key);
@override
State<StatefulWidget> createState() => _ComicInfoScreenState();
@ -36,6 +40,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
late Key _comicFutureKey = UniqueKey();
late Future<ViewLog?> _viewFuture = _loadViewLog();
late Future<List<Ep>> _epListFuture = _loadEps();
StreamSubscription<String?>? _linkSubscription;
Future<ComicInfo> _loadComic() async {
return await method.comicInfo(widget.comicId);
@ -69,14 +74,23 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
});
}
@override
void initState() {
if (widget.holdPkz) {
_linkSubscription = linkSubscript(context);
}
super.initState();
}
@override
void dispose() {
_linkSubscription?.cancel();
routeObserver.unsubscribe(this);
super.dispose();
}
@override
Widget build(BuildContext context){
Widget build(BuildContext context) {
return rightClickPop(
child: buildScreen(context),
context: context,

View File

@ -33,6 +33,7 @@ import 'package:pikapika/basic/config/UsingRightClickPop.dart';
import 'package:pikapika/basic/config/Version.dart';
import 'package:pikapika/basic/config/VolumeController.dart';
import 'package:pikapika/basic/config/ShadowCategoriesMode.dart';
import 'package:pikapika/screens/ComicInfoScreen.dart';
import 'package:pikapika/screens/PkzArchiveScreen.dart';
import 'package:uni_links/uni_links.dart';
import 'package:uri_to_file/uri_to_file.dart';
@ -107,7 +108,14 @@ class _InitScreenState extends State<InitScreen> {
}
}
if (initUrl != null) {
if (RegExp(r"^.*\.pkz$").allMatches(initUrl!).isNotEmpty) {
if (RegExp(r"^pika://comic/([0-9A-z]+)/$").allMatches(initUrl!).isNotEmpty) {
String comicId = RegExp(r"^pika://comic/([0-9A-z]+)/$").allMatches(initUrl!).first.group(1)!;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) =>
ComicInfoScreen(comicId: comicId, holdPkz: true),
));
return;
} else if (RegExp(r"^.*\.pkz$").allMatches(initUrl!).isNotEmpty) {
File file = await toFile(initUrl!);
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) =>

View File

@ -104,14 +104,17 @@ class _KnightLeaderBoard extends StatefulWidget {
class _KnightLeaderBoardState extends State<_KnightLeaderBoard> {
Future<List<Knight>> _future = method.leaderboardOfKnight();
Key _key = UniqueKey();
@override
Widget build(BuildContext context) {
return ContentBuilder(
key: _key,
future: _future,
onRefresh: () async {
setState(() {
_future = method.leaderboardOfKnight();
_key = UniqueKey();
});
},
successBuilder: (

View File

@ -387,6 +387,15 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
],
),
),
widget.struct.fullScreen
? Container()
: Container(
color: const Color(0x88000000),
child: SafeArea(
top: false,
child: Container(),
),
),
],
);
case ReaderSliderPosition.RIGHT:
@ -1579,7 +1588,7 @@ class _GalleryReaderState extends _ImageReaderContentState {
if (item.pkzFile != null) {
return PhotoViewGalleryPageOptions(
imageProvider:
PkzImageProvider(item.pkzFile!.pkzPath, item.pkzFile!.path),
PkzImageProvider(item.pkzFile!.pkzPath, item.pkzFile!.path),
errorBuilder: (b, e, s) {
print("$e,$s");
return LayoutBuilder(