diff --git a/.gitignore b/.gitignore index 88105a7a8..dc633ba0c 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,5 @@ ws.dart *.o *.d # *.so -# p7zip/CPP/ANDROID/7zr/obj/* \ No newline at end of file +# p7zip/CPP/ANDROID/7zr/obj/* +lib/component/download/* \ No newline at end of file diff --git a/lib/component/downloadable.dart b/lib/component/downloadable.dart index a79df84ff..d6df512f5 100644 --- a/lib/component/downloadable.dart +++ b/lib/component/downloadable.dart @@ -26,8 +26,27 @@ abstract class Session { } } +abstract class DownloadTask { + int taskId; + String accept = + "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"; + String userAgent = + "Mozilla/5.0 (Android 7.0; Mobile; rv:54.0) Gecko/54.0 Firefox/54.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/603.2.4"; + String referer; + bool autoRedirection; + bool retryWhenFail; + int maxRetryCount; + String cookie; + String url; + List failUrls; + Map headers; + Map query; + String filename; +} + abstract class Downloadable { bool loginRequire(); Session getSession(String id, String pwd); bool acceptURL(String url); + Future> createTask(String url); } diff --git a/lib/component/pixiv/pixiv.dart b/lib/component/pixiv/pixiv.dart deleted file mode 100644 index 2ae27d963..000000000 --- a/lib/component/pixiv/pixiv.dart +++ /dev/null @@ -1,5 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020. violet-team. Licensed under the MIT License. - -// Reference https://github.com/rollrat/downloader/blob/master/Koromo_Copy.Framework/Extractor/PixivExtractor.cs -class PixivManager {} diff --git a/lib/pages/after_loading/afterloading_page.dart b/lib/pages/after_loading/afterloading_page.dart index 04889c67e..388f12cc2 100644 --- a/lib/pages/after_loading/afterloading_page.dart +++ b/lib/pages/after_loading/afterloading_page.dart @@ -7,6 +7,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart import 'package:violet/locale.dart'; import 'package:violet/main.dart'; import 'package:violet/pages/bookmark/bookmark_page.dart'; +import 'package:violet/pages/download/download_page.dart'; import 'package:violet/pages/main/main_page.dart'; import 'package:violet/pages/search/search_page.dart'; import 'package:violet/pages/settings/settings_page.dart'; @@ -82,9 +83,9 @@ class _AfterLoadingPageState extends State // new BottomNavigationBarItem( // icon: new Icon(MdiIcons.accountGroup), // title: new Text(Translations.of(context).trans('community'))), - // new BottomNavigationBarItem( - // icon: new Icon(Icons.file_download), - // title: new Text(Translations.of(context).trans('download'))), + new BottomNavigationBarItem( + icon: new Icon(Icons.file_download), + title: new Text(Translations.of(context).trans('download'))), new BottomNavigationBarItem( backgroundColor: Settings.themeWhat ? Colors.grey.shade900.withOpacity(0.90) @@ -186,6 +187,7 @@ class _AfterLoadingPageState extends State // ), // ), // ), + DownloadPage(), BookmarkPage(), // new Center( // child: Padding( diff --git a/lib/pages/download/native_downloader.dart b/lib/pages/download/native_downloader.dart new file mode 100644 index 000000000..ba1fab5e7 --- /dev/null +++ b/lib/pages/download/native_downloader.dart @@ -0,0 +1,2 @@ +// This source code is a part of Project Violet. +// Copyright (C) 2020. violet-team. Licensed under the MIT License. diff --git a/lib/pages/settings/version_page.dart b/lib/pages/settings/version_page.dart index 312ec4081..44bcc6986 100644 --- a/lib/pages/settings/version_page.dart +++ b/lib/pages/settings/version_page.dart @@ -29,7 +29,7 @@ class VersionViewPage extends StatelessWidget { style: TextStyle(fontSize: 30), ), Text( - '0.7.6', + '0.7.7', style: TextStyle(fontSize: 20), ), Text(''), diff --git a/lib/update_sync.dart b/lib/update_sync.dart index 538bfdda0..217c06dbe 100644 --- a/lib/update_sync.dart +++ b/lib/update_sync.dart @@ -15,7 +15,7 @@ class UpdateSyncManager { // Current version static const int majorVersion = 0; static const int minorVersion = 7; - static const int patchVersion = 6; + static const int patchVersion = 7; static bool updateRequire = false; static String version = ""; diff --git a/pubspec.yaml b/pubspec.yaml index cce8e7042..3cad21ba4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.7.6+0 +version: 0.7.7+0 environment: sdk: ">=2.2.0 <3.0.0" @@ -28,7 +28,7 @@ dependencies: animations: async: auto_animated: any - cached_network_image: ^2.3.0-rc + cached_network_image: charts_flutter: circular_check_box: ^1.0.1 cloud_firestore: ^0.13.0+1