Skip to content

Commit

Permalink
1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Oct 14, 2022
1 parent 33b8dd9 commit 8640181
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.5
v1.3.6
10 changes: 10 additions & 0 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## !! WARNING !!

本次升级IOS将会迁移数据, 第一次打开会白屏一段时间, 如某些功能出现闪退, 请删除软件并重新安装. 其他平台不受影响.

v1.3.6

- [x] ♻️优化:IOS导入导出不再出错
- [x] ♻️优化:升级SQL引擎
- [x] 🐛修复:横向Webtoon全屏切换抖动

v1.3.5

- [x] ♻️优化:导出导入速度提升数倍
Expand Down
22 changes: 18 additions & 4 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ import Flutter
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {

let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
let chars = documentsPath.cString(using: String.Encoding.utf8)

// let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
// let chars = documentDirectory.cString(using: String.Encoding.utf8)
//
// init_ffi(chars!)



let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
let fromChars = documentDirectory.cString(using: String.Encoding.utf8)

let applicationSupportDirectory = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true)[0]
let chars = applicationSupportDirectory.cString(using: String.Encoding.utf8)

migration_ffi(fromChars,chars)
init_ffi(chars!)


let controller = self.window.rootViewController as! FlutterViewController
FlutterMethodChannel.init(name: "methods", binaryMessenger: controller as! FlutterBinaryMessenger).setMethodCallHandler { (call, result) in
Expand Down Expand Up @@ -43,6 +55,8 @@ import Flutter
}else{
result(FlutterError(code: "", message: "params error", details: ""))
}
case "iosGetDocumentDir" :
result(documentDirectory)
default:
result(FlutterMethodNotImplemented)
}
Expand Down
4 changes: 4 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
Expand Down
3 changes: 3 additions & 0 deletions lib/basic/methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ class Methods {
return _invoke("sync_webdav", params);
}

Future<String> iosGetDocumentDir() async {
return await _channel.invokeMethod("iosGetDocumentDir");
}
}

class _Response {
Expand Down
47 changes: 22 additions & 25 deletions lib/screens/comic_reader_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:io';
import 'dart:math';

import 'package:another_xlider/another_xlider.dart';
import 'package:event/event.dart';
Expand Down Expand Up @@ -368,14 +369,15 @@ abstract class _ComicReaderState extends State<_ComicReader> {
!_fullScreen) {
return Container();
}
if (ReaderSliderPosition.right == currentReaderSliderPosition){
return SafeArea(child: Align(
if (ReaderSliderPosition.right == currentReaderSliderPosition) {
return SafeArea(
child: Align(
alignment: Alignment.bottomRight,
child: Material(
color: Colors.transparent,
child: Container(
padding:
const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4),
const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4),
margin: const EdgeInsets.only(bottom: 10),
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
Expand All @@ -398,13 +400,14 @@ abstract class _ComicReaderState extends State<_ComicReader> {
),
));
}
return SafeArea(child: Align(
return SafeArea(
child: Align(
alignment: Alignment.bottomLeft,
child: Material(
color: Colors.transparent,
child: Container(
padding:
const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4),
const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4),
margin: const EdgeInsets.only(bottom: 10),
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
Expand Down Expand Up @@ -566,12 +569,12 @@ abstract class _ComicReaderState extends State<_ComicReader> {
_fullScreen
? Container()
: Container(
color: const Color(0x88000000),
child: SafeArea(
top: false,
child: Container(),
),
),
color: const Color(0x88000000),
child: SafeArea(
top: false,
child: Container(),
),
),
],
);
case ReaderSliderPosition.right:
Expand Down Expand Up @@ -1042,9 +1045,8 @@ class _ComicReaderWebToonState extends _ComicReaderState {
} else {
var maxHeight = constraints.maxHeight -
super._appBarHeight() -
(super._fullScreen
? super._appBarHeight()
: super._bottomBarHeight());
super._bottomBarHeight() -
MediaQuery.of(context).padding.bottom;
renderSize = Size(
maxHeight *
_trueSizes[index]!.width /
Expand Down Expand Up @@ -1090,10 +1092,8 @@ class _ComicReaderWebToonState extends _ComicReaderState {
top: super._appBarHeight(),
bottom: widget.readerDirection == ReaderDirection.topToBottom
? 130 // 纵向滚动 底部永远都是130的空白
: ( // 横向滚动
super._fullScreen
? super._appBarHeight() // 全屏时底部和顶部到屏幕边框距离一样保持美观
: super._bottomBarHeight())
: (super._bottomBarHeight() +
MediaQuery.of(context).padding.bottom)
// 非全屏时, 顶部去掉顶部BAR的高度, 底部去掉底部BAR的高度, 形成看似填充的效果
,
),
Expand Down Expand Up @@ -1357,15 +1357,12 @@ class _ListViewReaderState extends _ComicReaderState
reverse: currentReaderDirection == ReaderDirection.rightToLeft,
padding: EdgeInsets.only(
// 不管全屏与否, 滚动方向如何, 顶部永远保持间距
top: super._appBarHeight(),
top: currentReaderDirection == ReaderDirection.topToBottom
? super._appBarHeight()
: max(super._appBarHeight(), super._bottomBarHeight()),
bottom: currentReaderDirection == ReaderDirection.topToBottom
? 130 // 纵向滚动 底部永远都是130的空白
: ( // 横向滚动
super._fullScreen
? super._appBarHeight() // 全屏时底部和顶部到屏幕边框距离一样保持美观
: super._bottomBarHeight())
// 非全屏时, 顶部去掉顶部BAR的高度, 底部去掉底部BAR的高度, 形成看似填充的效果
,
: max(super._appBarHeight(), super._bottomBarHeight()),
),
itemCount: widget.chapter.images.length + 1,
itemBuilder: (BuildContext context, int index) {
Expand Down
10 changes: 8 additions & 2 deletions lib/screens/downloads_exporting_screen.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:jasmine/basic/methods.dart';

Expand Down Expand Up @@ -122,7 +124,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
}
late String? path;
try {
path = await chooseFolder(context);
path = Platform.isIOS
? await methods.iosGetDocumentDir()
: await chooseFolder(context);
} catch (e) {
defaultToast(context, "$e");
return;
Expand Down Expand Up @@ -156,7 +160,9 @@ class _DownloadsExportingScreenState extends State<DownloadsExportingScreen> {
}
late String? path;
try {
path = await chooseFolder(context);
path = Platform.isIOS
? await methods.iosGetDocumentDir()
: await chooseFolder(context);
} catch (e) {
defaultToast(context, "$e");
return;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: jasmine comic browser

publish_to: 'none'

version: 1.3.4+7
version: 1.3.6+8

environment:
sdk: ">=2.15.1 <3.0.0"
Expand Down

0 comments on commit 8640181

Please sign in to comment.