diff --git a/violet/assets/locale/en.json b/violet/assets/locale/en.json index c1e606428..2ffc10967 100644 --- a/violet/assets/locale/en.json +++ b/violet/assets/locale/en.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/eo.json b/violet/assets/locale/eo.json index 0a42a1fd3..6b43819b5 100644 --- a/violet/assets/locale/eo.json +++ b/violet/assets/locale/eo.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/it.json b/violet/assets/locale/it.json index 7e65f8d17..4d5c4c908 100644 --- a/violet/assets/locale/it.json +++ b/violet/assets/locale/it.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/ja.json b/violet/assets/locale/ja.json index 0972878f0..4c3f5b753 100644 --- a/violet/assets/locale/ja.json +++ b/violet/assets/locale/ja.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/ko.json b/violet/assets/locale/ko.json index 9bdc47528..3a4e5de99 100644 --- a/violet/assets/locale/ko.json +++ b/violet/assets/locale/ko.json @@ -304,7 +304,6 @@ "aligngroup": "그룹 순으로 정렬", "alignpage": "페이지수순으로 정렬", "alignrecentread": "최근 읽은 순으로 정렬", - "litemode": "라이트 모드", "hot": "인기", "faq": "자주 묻는 질문", "usermanual": "유저 메뉴얼", diff --git a/violet/assets/locale/pt.json b/violet/assets/locale/pt.json index 0c820b9e6..09f4032fc 100644 --- a/violet/assets/locale/pt.json +++ b/violet/assets/locale/pt.json @@ -304,7 +304,6 @@ "aligngroup": "Ordenar por grupos", "alignpage": "Ordenar por contagem de páginas", "alignrecentread": "Ordenar por lidos recentemente", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/zh.json b/violet/assets/locale/zh.json index 0af4f5bbc..c7d0389a0 100644 --- a/violet/assets/locale/zh.json +++ b/violet/assets/locale/zh.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/zh_Hans.json b/violet/assets/locale/zh_Hans.json index 35f511ad5..237f44b5a 100644 --- a/violet/assets/locale/zh_Hans.json +++ b/violet/assets/locale/zh_Hans.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/assets/locale/zh_Hant.json b/violet/assets/locale/zh_Hant.json index d4a7a22d6..1632cf523 100644 --- a/violet/assets/locale/zh_Hant.json +++ b/violet/assets/locale/zh_Hant.json @@ -304,7 +304,6 @@ "aligngroup": "Sort by Group", "alignpage": "Sort by Page Count", "alignrecentread": "Sort by Recent Read", - "litemode": "Lite Mode", "hot": "Hot", "faq": "Frequently Asked Questions", "usermanual": "User Manual", diff --git a/violet/lib/pages/after_loading/afterloading_page.dart b/violet/lib/pages/after_loading/afterloading_page.dart index 4cc1bbb5d..4308209b2 100644 --- a/violet/lib/pages/after_loading/afterloading_page.dart +++ b/violet/lib/pages/after_loading/afterloading_page.dart @@ -21,7 +21,6 @@ import 'package:violet/pages/common/utils.dart'; import 'package:violet/pages/download/download_page.dart'; import 'package:violet/pages/hot/hot_page.dart'; import 'package:violet/pages/lock/lock_screen.dart'; -import 'package:violet/pages/main/main_page.dart'; import 'package:violet/pages/search/search_page.dart'; import 'package:violet/pages/segment/double_tap_to_top.dart'; import 'package:violet/pages/settings/settings_page.dart'; @@ -117,7 +116,7 @@ class AfterLoadingPageState extends State bool _isDoubleTap = false; late final List> _widgetKeys = - List.generate(7, (index) => GlobalKey()); + List.generate(5, (index) => GlobalKey()); Widget _buildBottomNavigationBar(BuildContext context) { final translations = Translations.instance!; @@ -159,7 +158,6 @@ class AfterLoadingPageState extends State } else { if (_isDoubleTap) { // something to do for double tap - if (index >= 2 || Settings.liteMode) index += 1; (_widgetKeys[index].currentState as DoubleTapToTopMixin) .animateToTop(); @@ -173,9 +171,8 @@ class AfterLoadingPageState extends State } }, items: [ - if (!Settings.liteMode) buildItem(MdiIcons.home, 'main'), buildItem(Icons.search, 'search'), - if (Settings.liteMode) buildItem(MdiIcons.fire, 'hot'), + buildItem(MdiIcons.fire, 'hot'), buildItem(Icons.bookmark, 'bookmark'), buildItem(Icons.file_download, 'download'), buildItem(Icons.settings, 'settings'), @@ -281,9 +278,8 @@ class AfterLoadingPageState extends State ], ), ), - if (!Settings.liteMode) buildButton(MdiIcons.home, 0, 'main'), - buildButton(Icons.search, !Settings.liteMode ? 1 : 0, 'search'), - if (Settings.liteMode) buildButton(MdiIcons.fire, 1, 'hot'), + buildButton(Icons.search, 0, 'search'), + buildButton(MdiIcons.fire, 1, 'hot'), buildButton(MdiIcons.bookmark, 2, 'bookmark'), buildButton(MdiIcons.download, 3, 'download'), buildButton(Icons.settings, 4, 'settings'), @@ -357,12 +353,11 @@ class AfterLoadingPageState extends State setState(() {}); }, children: [ - if (!Settings.liteMode) MainPage(key: _widgetKeys[0]), - SearchPage(key: _widgetKeys[1]), - if (Settings.liteMode) HotPage(key: _widgetKeys[2]), - BookmarkPage(key: _widgetKeys[3]), - DownloadPage(key: _widgetKeys[4]), - SettingsPage(key: _widgetKeys[5]), + SearchPage(key: _widgetKeys[0]), + HotPage(key: _widgetKeys[1]), + BookmarkPage(key: _widgetKeys[2]), + DownloadPage(key: _widgetKeys[3]), + SettingsPage(key: _widgetKeys[4]), ], ), ], diff --git a/violet/lib/pages/article_info/article_info_page.dart b/violet/lib/pages/article_info/article_info_page.dart index 64eb6e091..1aa0645be 100644 --- a/violet/lib/pages/article_info/article_info_page.dart +++ b/violet/lib/pages/article_info/article_info_page.dart @@ -36,7 +36,7 @@ import 'package:violet/pages/artist_info/artist_info_page.dart'; import 'package:violet/pages/common/toast.dart'; import 'package:violet/pages/common/utils.dart'; import 'package:violet/pages/download/download_page.dart'; -import 'package:violet/pages/main/info/lab/search_comment_author.dart'; +import 'package:violet/pages/lab/lab/search_comment_author.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/pages/viewer/viewer_page.dart'; import 'package:violet/pages/viewer/viewer_page_provider.dart'; diff --git a/violet/lib/pages/main/info/lab/artist_search/artist_search.dart b/violet/lib/pages/lab/lab/artist_search/artist_search.dart similarity index 99% rename from violet/lib/pages/main/info/lab/artist_search/artist_search.dart rename to violet/lib/pages/lab/lab/artist_search/artist_search.dart index 8c3f0b5cb..bdf55f15a 100644 --- a/violet/lib/pages/main/info/lab/artist_search/artist_search.dart +++ b/violet/lib/pages/lab/lab/artist_search/artist_search.dart @@ -13,7 +13,7 @@ import 'package:violet/database/query.dart'; import 'package:violet/database/user/bookmark.dart'; import 'package:violet/locale/locale.dart'; import 'package:violet/pages/artist_info/artist_info_page.dart'; -import 'package:violet/pages/main/info/lab/artist_search/tag_group_modify.dart'; +import 'package:violet/pages/lab/lab/artist_search/tag_group_modify.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; diff --git a/violet/lib/pages/main/info/lab/artist_search/tag_group_modify.dart b/violet/lib/pages/lab/lab/artist_search/tag_group_modify.dart similarity index 98% rename from violet/lib/pages/main/info/lab/artist_search/tag_group_modify.dart rename to violet/lib/pages/lab/lab/artist_search/tag_group_modify.dart index bacb334c2..6081e0cd0 100644 --- a/violet/lib/pages/main/info/lab/artist_search/tag_group_modify.dart +++ b/violet/lib/pages/lab/lab/artist_search/tag_group_modify.dart @@ -7,7 +7,7 @@ import 'package:get/get.dart'; import 'package:uuid/uuid.dart'; import 'package:violet/locale/locale.dart' as trans; import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/main/info/lab/artist_search/tag_group_modify_controller.dart'; +import 'package:violet/pages/lab/lab/artist_search/tag_group_modify_controller.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/settings/tag_selector.dart'; import 'package:violet/settings/settings.dart'; diff --git a/violet/lib/pages/main/info/lab/artist_search/tag_group_modify_controller.dart b/violet/lib/pages/lab/lab/artist_search/tag_group_modify_controller.dart similarity index 100% rename from violet/lib/pages/main/info/lab/artist_search/tag_group_modify_controller.dart rename to violet/lib/pages/lab/lab/artist_search/tag_group_modify_controller.dart diff --git a/violet/lib/pages/main/info/lab/bookmark/bookmarks.dart b/violet/lib/pages/lab/lab/bookmark/bookmarks.dart similarity index 98% rename from violet/lib/pages/main/info/lab/bookmark/bookmarks.dart rename to violet/lib/pages/lab/lab/bookmark/bookmarks.dart index c0503df85..9f466f9d7 100644 --- a/violet/lib/pages/main/info/lab/bookmark/bookmarks.dart +++ b/violet/lib/pages/lab/lab/bookmark/bookmarks.dart @@ -7,8 +7,8 @@ import 'package:sqflite/sqflite.dart'; import 'package:violet/database/user/bookmark.dart'; import 'package:violet/locale/locale.dart'; import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/main/info/lab/bookmark/bookmarks_article_list.dart'; -import 'package:violet/pages/main/info/lab/bookmark/bookmarks_records.dart'; +import 'package:violet/pages/lab/lab/bookmark/bookmarks_article_list.dart'; +import 'package:violet/pages/lab/lab/bookmark/bookmarks_records.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/server/violet.dart'; import 'package:violet/settings/settings.dart'; diff --git a/violet/lib/pages/main/info/lab/bookmark/bookmarks_article_list.dart b/violet/lib/pages/lab/lab/bookmark/bookmarks_article_list.dart similarity index 99% rename from violet/lib/pages/main/info/lab/bookmark/bookmarks_article_list.dart rename to violet/lib/pages/lab/lab/bookmark/bookmarks_article_list.dart index a21c81c7c..2aa8e900c 100644 --- a/violet/lib/pages/main/info/lab/bookmark/bookmarks_article_list.dart +++ b/violet/lib/pages/lab/lab/bookmark/bookmarks_article_list.dart @@ -12,7 +12,7 @@ import 'package:violet/database/user/bookmark.dart'; import 'package:violet/model/article_list_item.dart'; import 'package:violet/network/wrapper.dart' as http; import 'package:violet/pages/artist_info/search_type2.dart'; -import 'package:violet/pages/main/info/lab/bookmark/bookmarks_artist_list.dart'; +import 'package:violet/pages/lab/lab/bookmark/bookmarks_artist_list.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/filter_page.dart'; import 'package:violet/pages/segment/filter_page_controller.dart'; diff --git a/violet/lib/pages/main/info/lab/bookmark/bookmarks_artist_list.dart b/violet/lib/pages/lab/lab/bookmark/bookmarks_artist_list.dart similarity index 100% rename from violet/lib/pages/main/info/lab/bookmark/bookmarks_artist_list.dart rename to violet/lib/pages/lab/lab/bookmark/bookmarks_artist_list.dart diff --git a/violet/lib/pages/main/info/lab/bookmark/bookmarks_records.dart b/violet/lib/pages/lab/lab/bookmark/bookmarks_records.dart similarity index 100% rename from violet/lib/pages/main/info/lab/bookmark/bookmarks_records.dart rename to violet/lib/pages/lab/lab/bookmark/bookmarks_records.dart diff --git a/violet/lib/pages/main/info/lab/bookmark_spy.dart b/violet/lib/pages/lab/lab/bookmark_spy.dart similarity index 98% rename from violet/lib/pages/main/info/lab/bookmark_spy.dart rename to violet/lib/pages/lab/lab/bookmark_spy.dart index fe62a1bc1..496b60aa7 100644 --- a/violet/lib/pages/main/info/lab/bookmark_spy.dart +++ b/violet/lib/pages/lab/lab/bookmark_spy.dart @@ -6,7 +6,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:violet/database/user/bookmark.dart'; -import 'package:violet/pages/main/info/lab/bookmark/bookmarks.dart'; +import 'package:violet/pages/lab/lab/bookmark/bookmarks.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/server/violet.dart'; diff --git a/violet/lib/pages/main/info/lab/global_comments.dart b/violet/lib/pages/lab/lab/global_comments.dart similarity index 99% rename from violet/lib/pages/main/info/lab/global_comments.dart rename to violet/lib/pages/lab/lab/global_comments.dart index 039d45eba..d8032abed 100644 --- a/violet/lib/pages/main/info/lab/global_comments.dart +++ b/violet/lib/pages/lab/lab/global_comments.dart @@ -7,7 +7,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart import 'package:mdi/mdi.dart'; import 'package:violet/locale/locale.dart'; import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/main/info/lab/recent_user_record.dart'; +import 'package:violet/pages/lab/lab/recent_user_record.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/server/community/anon.dart'; diff --git a/violet/lib/pages/main/info/lab/recent_comments.dart b/violet/lib/pages/lab/lab/recent_comments.dart similarity index 100% rename from violet/lib/pages/main/info/lab/recent_comments.dart rename to violet/lib/pages/lab/lab/recent_comments.dart diff --git a/violet/lib/pages/main/info/lab/recent_record.dart b/violet/lib/pages/lab/lab/recent_record.dart similarity index 100% rename from violet/lib/pages/main/info/lab/recent_record.dart rename to violet/lib/pages/lab/lab/recent_record.dart diff --git a/violet/lib/pages/main/info/lab/recent_record_u.dart b/violet/lib/pages/lab/lab/recent_record_u.dart similarity index 99% rename from violet/lib/pages/main/info/lab/recent_record_u.dart rename to violet/lib/pages/lab/lab/recent_record_u.dart index c27557b94..d7f3c1dab 100644 --- a/violet/lib/pages/main/info/lab/recent_record_u.dart +++ b/violet/lib/pages/lab/lab/recent_record_u.dart @@ -12,7 +12,7 @@ import 'package:violet/database/query.dart'; import 'package:violet/locale/locale.dart'; import 'package:violet/log/log.dart'; import 'package:violet/model/article_list_item.dart'; -import 'package:violet/pages/main/info/lab/recent_user_record.dart'; +import 'package:violet/pages/lab/lab/recent_user_record.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/server/violet.dart'; diff --git a/violet/lib/pages/main/info/lab/recent_user_record.dart b/violet/lib/pages/lab/lab/recent_user_record.dart similarity index 100% rename from violet/lib/pages/main/info/lab/recent_user_record.dart rename to violet/lib/pages/lab/lab/recent_user_record.dart diff --git a/violet/lib/pages/main/info/lab/search_comment.dart b/violet/lib/pages/lab/lab/search_comment.dart similarity index 97% rename from violet/lib/pages/main/info/lab/search_comment.dart rename to violet/lib/pages/lab/lab/search_comment.dart index d7544e3da..e5f72dd23 100644 --- a/violet/lib/pages/main/info/lab/search_comment.dart +++ b/violet/lib/pages/lab/lab/search_comment.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:violet/pages/common/utils.dart'; -import 'package:violet/pages/main/info/lab/search_comment_author.dart'; +import 'package:violet/pages/lab/lab/search_comment_author.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/server/violet.dart'; diff --git a/violet/lib/pages/main/info/lab/search_comment_author.dart b/violet/lib/pages/lab/lab/search_comment_author.dart similarity index 100% rename from violet/lib/pages/main/info/lab/search_comment_author.dart rename to violet/lib/pages/lab/lab/search_comment_author.dart diff --git a/violet/lib/pages/main/info/lab/search_message.dart b/violet/lib/pages/lab/lab/search_message.dart similarity index 99% rename from violet/lib/pages/main/info/lab/search_message.dart rename to violet/lib/pages/lab/lab/search_message.dart index f707cf68a..ae555e689 100644 --- a/violet/lib/pages/main/info/lab/search_message.dart +++ b/violet/lib/pages/lab/lab/search_message.dart @@ -13,7 +13,7 @@ import 'package:violet/component/image_provider.dart'; import 'package:violet/network/wrapper.dart' as http; import 'package:violet/other/dialogs.dart'; import 'package:violet/pages/common/utils.dart'; -import 'package:violet/pages/main/info/lab/search_message_rank.dart'; +import 'package:violet/pages/lab/lab/search_message_rank.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/script/script_manager.dart'; diff --git a/violet/lib/pages/main/info/lab/search_message_rank.dart b/violet/lib/pages/lab/lab/search_message_rank.dart similarity index 100% rename from violet/lib/pages/main/info/lab/search_message_rank.dart rename to violet/lib/pages/lab/lab/search_message_rank.dart diff --git a/violet/lib/pages/main/info/lab/setting.dart b/violet/lib/pages/lab/lab/setting.dart similarity index 100% rename from violet/lib/pages/main/info/lab/setting.dart rename to violet/lib/pages/lab/lab/setting.dart diff --git a/violet/lib/pages/main/info/lab/statistics.dart b/violet/lib/pages/lab/lab/statistics.dart similarity index 100% rename from violet/lib/pages/main/info/lab/statistics.dart rename to violet/lib/pages/lab/lab/statistics.dart diff --git a/violet/lib/pages/main/info/lab/top_recent.dart b/violet/lib/pages/lab/lab/top_recent.dart similarity index 100% rename from violet/lib/pages/main/info/lab/top_recent.dart rename to violet/lib/pages/lab/lab/top_recent.dart diff --git a/violet/lib/pages/main/info/lab/user_bookmark_page.dart b/violet/lib/pages/lab/lab/user_bookmark_page.dart similarity index 98% rename from violet/lib/pages/main/info/lab/user_bookmark_page.dart rename to violet/lib/pages/lab/lab/user_bookmark_page.dart index 42b9a2e7f..646fc2647 100644 --- a/violet/lib/pages/main/info/lab/user_bookmark_page.dart +++ b/violet/lib/pages/lab/lab/user_bookmark_page.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:violet/database/user/bookmark.dart'; import 'package:violet/pages/bookmark/group_modify.dart'; -import 'package:violet/pages/main/info/lab/recent_user_record.dart'; +import 'package:violet/pages/lab/lab/recent_user_record.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/settings/settings.dart'; diff --git a/violet/lib/pages/main/info/lab_page.dart b/violet/lib/pages/lab/lab_page.dart similarity index 95% rename from violet/lib/pages/main/info/lab_page.dart rename to violet/lib/pages/lab/lab_page.dart index 33f2c37bb..3504a9b20 100644 --- a/violet/lib/pages/main/info/lab_page.dart +++ b/violet/lib/pages/lab/lab_page.dart @@ -16,17 +16,17 @@ import 'package:violet/log/act_log.dart'; import 'package:violet/other/dialogs.dart'; import 'package:violet/pages/artist_info/article_list_page.dart'; import 'package:violet/pages/bookmark/crop_bookmark.dart'; -import 'package:violet/pages/main/info/lab/artist_search/artist_search.dart'; -import 'package:violet/pages/main/info/lab/bookmark_spy.dart'; -import 'package:violet/pages/main/info/lab/recent_comments.dart'; -import 'package:violet/pages/main/info/lab/recent_record.dart'; -import 'package:violet/pages/main/info/lab/recent_record_u.dart'; -import 'package:violet/pages/main/info/lab/search_comment.dart'; -import 'package:violet/pages/main/info/lab/search_message.dart'; -import 'package:violet/pages/main/info/lab/setting.dart'; -import 'package:violet/pages/main/info/lab/statistics.dart'; -import 'package:violet/pages/main/info/lab/top_recent.dart'; -import 'package:violet/pages/main/info/lab/user_bookmark_page.dart'; +import 'package:violet/pages/lab/lab/artist_search/artist_search.dart'; +import 'package:violet/pages/lab/lab/bookmark_spy.dart'; +import 'package:violet/pages/lab/lab/recent_comments.dart'; +import 'package:violet/pages/lab/lab/recent_record.dart'; +import 'package:violet/pages/lab/lab/recent_record_u.dart'; +import 'package:violet/pages/lab/lab/search_comment.dart'; +import 'package:violet/pages/lab/lab/search_message.dart'; +import 'package:violet/pages/lab/lab/setting.dart'; +import 'package:violet/pages/lab/lab/statistics.dart'; +import 'package:violet/pages/lab/lab/top_recent.dart'; +import 'package:violet/pages/lab/lab/user_bookmark_page.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/pages/settings/log_page.dart'; diff --git a/violet/lib/pages/main/buttons/carousel_button.dart b/violet/lib/pages/main/buttons/carousel_button.dart deleted file mode 100644 index 64e10415f..000000000 --- a/violet/lib/pages/main/buttons/carousel_button.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class CarouselButton extends StatelessWidget { - const CarouselButton({ - super.key, - required this.uri, - required this.backgroundColor, - required this.icon, - required this.label, - }); - - final Uri? uri; - final Color backgroundColor; - final Widget icon; - final Widget label; - - Future _handleTapAsync() async { - final uri = this.uri; - - if (uri == null) { - return; - } - - if (await canLaunchUrl(uri)) { - await launchUrl(uri); - } - } - - void _handleTap() { - _handleTapAsync(); - } - - @override - Widget build(BuildContext context) { - return Card( - margin: EdgeInsets.zero, - color: backgroundColor, - child: InkWell( - onTap: _handleTap, - child: Center( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconTheme( - data: Theme.of(context).iconTheme.copyWith(color: Colors.white), - child: icon, - ), - const SizedBox(width: 8.0), - Padding( - padding: const EdgeInsets.only(top: 4.0), - child: DefaultTextStyle.merge( - style: const TextStyle( - fontSize: 18.0, - fontFamily: 'Calibre-Semibold', - letterSpacing: 0.5, - color: Colors.white, - ), - child: label, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/violet/lib/pages/main/card/artist_collection_card.dart b/violet/lib/pages/main/card/artist_collection_card.dart deleted file mode 100644 index 80765c52c..000000000 --- a/violet/lib/pages/main/card/artist_collection_card.dart +++ /dev/null @@ -1,128 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. - -/* - -import 'package:division/division.dart'; -import 'package:flutter/material.dart'; -import 'package:gradient_widgets/gradient_widgets.dart'; -import 'package:pimp_my_button/pimp_my_button.dart'; -import 'package:violet/locale/locale.dart'; -import 'package:violet/pages/main/artist_collection/artist_collection_page.dart'; -import 'package:violet/pages/main/card/update_card.dart'; -import 'package:violet/pages/segment/platform_navigator.dart'; - -class ArtistCollectionCard extends StatefulWidget { - const ArtistCollectionCard({Key? key}) : super(key: key); - - @override - State createState() => _ArtistCollectionCarddState(); -} - -class _ArtistCollectionCarddState extends State - with TickerProviderStateMixin { - bool pressed = false; - - @override - Widget build(BuildContext context) { - final double width = MediaQuery.of(context).size.width; - return SizedBox( - width: width - 16, - height: 75, - child: PimpedButton( - particle: MyRectangle2DemoParticle(), - pimpedWidgetBuilder: (context, controller) { - return Parent( - style: settingsItemStyle(pressed), - gesture: Gestures() - ..isTap((isTapped) { - setState(() => pressed = isTapped); - if (!isTapped) { - controller!.forward(from: 0.0); - - PlatformNavigator.navigateSlide( - context, const ArtistCollectionPage()); - } - }), - child: Container( - height: 75, - decoration: BoxDecoration( - // color: Color(0xff00D99E), - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - blurRadius: 8, - offset: const Offset(0, 8), - color: Gradients.coldLinear.colors.first.withOpacity(.3), - spreadRadius: -9, - ), - ], - ), - child: GradientCard( - gradient: Gradients.coldLinear, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // SizedBox( - // width: 50, - // height: 50, - // child: Transform.translate( - // offset: Offset(-10, -20), - // child: Transform.scale( - // scale: 3.8, - // child: Center( - // child: Lottie.asset( - // 'assets/lottie/28446-floward-gift-box.json', - // ), - // ), - // ), - // ), - // // Icon( - // // MdiIcons.group, - // // color: Colors.white, - // // size: 30, - // // ), - // ), - Text( - Translations.instance!.trans('artistcollection'), - style: const TextStyle( - // fontFamily: "Calibre-Semibold", - // fontSize: 18, - color: Colors.white), - ), - ]), - ), - )); - }, - ), - ); - } - - ParentStyle settingsItemStyle(bool pressed) => ParentStyle() - ..elevation(pressed ? 0 : 10000, color: Colors.transparent) - ..scale(pressed ? 0.95 : 1.0) - ..alignmentContent.center() - // ..height(70) - // ..margin(vertical: 10) - // ..borderRadius(all: 15) - // ..background.hex('#ffffff') - ..ripple(true) - ..animate(150, Curves.easeOut); - - ParentStyle settingsItemIconStyle(Color color) => ParentStyle() - ..background.color(color) - ..margin(left: 15) - ..padding(all: 12) - ..borderRadius(all: 30); - - final TxtStyle itemTitleTextStyle = TxtStyle() - ..bold() - ..fontSize(16); - - final TxtStyle itemDescriptionTextStyle = TxtStyle() - ..textColor(Colors.black26) - ..bold() - ..fontSize(12); -} - - */ diff --git a/violet/lib/pages/main/card/update_card.dart b/violet/lib/pages/main/card/update_card.dart deleted file mode 100644 index c1af9e9d3..000000000 --- a/violet/lib/pages/main/card/update_card.dart +++ /dev/null @@ -1,185 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. - -/* - -import 'dart:math'; - -import 'package:division/division.dart'; -import 'package:flutter/material.dart'; -import 'package:gradient_widgets/gradient_widgets.dart'; -import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; -import 'package:pimp_my_button/pimp_my_button.dart'; - -class UpdateCard extends StatefulWidget { - final VoidCallback clickEvent; - - const UpdateCard({Key? key, required this.clickEvent}) : super(key: key); - - @override - State createState() => _UpdateCardState(); -} - -class _UpdateCardState extends State with TickerProviderStateMixin { - bool pressed = false; - late AnimationController rotationController; - - @override - void initState() { - super.initState(); - rotationController = AnimationController( - duration: const Duration(milliseconds: 270), - vsync: this, - // upperBound: pi * 2, - ); - } - - @override - Widget build(BuildContext context) { - final double width = MediaQuery.of(context).size.width; - return SizedBox( - width: width - 16, - height: 75, - child: PimpedButton( - particle: MyRectangle2DemoParticle(), - pimpedWidgetBuilder: (context, controller) { - return Parent( - style: settingsItemStyle(pressed), - gesture: Gestures() - ..isTap((isTapped) { - if (isTapped) { - rotationController.forward(from: 0.0); - } else { - rotationController.reverse(from: 0.7); - } - setState(() => pressed = isTapped); - controller!.forward(from: 0.0); - Future.delayed(const Duration(milliseconds: 200), - () => controller.forward(from: 0.0)); - // Future.delayed(Duration(milliseconds: 200), - // () => controller.forward(from: 0.0)); - // Future.delayed(Duration(milliseconds: 300), - // () => controller.forward(from: 0.0)); - widget.clickEvent(); - }), - child: Container( - decoration: BoxDecoration( - // color: Color(0xff00D99E), - borderRadius: BorderRadius.circular(8), - // gradient: LinearGradient( - // begin: Alignment.bottomLeft, - // end: Alignment(0.8, 0.0), - // colors: [ - // Gradients.backToFuture.colors.first.withOpacity(.3), - // Colors.indigo.withOpacity(.3), - // Gradients.backToFuture.colors.last.withOpacity(.3) - // ], - // tileMode: TileMode.clamp, - // ), - boxShadow: [ - BoxShadow( - blurRadius: 8, - offset: const Offset(0, 15), - color: - Gradients.backToFuture.colors.first.withOpacity(.3), - spreadRadius: -9, - ), - ], - ), - child: GradientCard( - gradient: Gradients.aliHussien, - // shadowColor: Gradients.backToFuture.colors.last.withOpacity(0.2), - // elevation: 8, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Center( - child: RotationTransition( - turns: Tween(begin: 0.0, end: 0.7) - .animate(rotationController), - child: const Icon( - MdiIcons.update, - color: Colors.white, - size: 30, - ), - ), - ), - const Padding( - padding: EdgeInsets.only(top: 4), - child: Text( - ' Tap Me!', - style: TextStyle( - fontFamily: 'Calibre-Semibold', - fontSize: 18, - color: Colors.white), - ), - ), - ] - // child: Text( - // // 'New Version', - // '', - // style: TextStyle( - // fontSize: 30, - // fontWeight: FontWeight.bold, - // fontFamily: "Calibre-Semibold", - // // letterSpacing: 1.0, - // ), - // ), - ), - ), - )); - }, - ), - ); - } - - ParentStyle settingsItemStyle(bool pressed) => ParentStyle() - ..elevation(pressed ? 0 : 10000, color: Colors.transparent) - ..scale(pressed ? 0.95 : 1.0) - ..alignmentContent.center() - // ..height(70) - // ..margin(vertical: 10) - // ..borderRadius(all: 15) - // ..background.hex('#ffffff') - ..ripple(true) - ..animate(150, Curves.easeOut); - - ParentStyle settingsItemIconStyle(Color color) => ParentStyle() - ..background.color(color) - ..margin(left: 15) - ..padding(all: 12) - ..borderRadius(all: 30); - - final TxtStyle itemTitleTextStyle = TxtStyle() - ..bold() - ..fontSize(16); - - final TxtStyle itemDescriptionTextStyle = TxtStyle() - ..textColor(Colors.black26) - ..bold() - ..fontSize(12); -} - -class MyRectangle2DemoParticle extends Particle { - @override - void paint(Canvas canvas, Size size, progress, seed) { - Random random = Random(seed); - int randomMirrorOffset = random.nextInt(10) + 1; - CompositeParticle(children: [ - Firework(), - RectangleMirror.builder( - numberOfParticles: random.nextInt(6) + 4, - particleBuilder: (int int) { - return AnimatedPositionedParticle( - begin: const Offset(0.0, -10.0), - end: const Offset(0.0, -60.0), - child: - FadingRect(width: 5.0, height: 15.0, color: intToColor(int)), - ); - }, - initialDistance: -pi / randomMirrorOffset), - ]).paint(canvas, size, progress, seed); - } -} - - */ diff --git a/violet/lib/pages/main/card/update_log_card.dart b/violet/lib/pages/main/card/update_log_card.dart deleted file mode 100644 index 9df37788c..000000000 --- a/violet/lib/pages/main/card/update_log_card.dart +++ /dev/null @@ -1,110 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. - -/* - -import 'package:division/division.dart'; -import 'package:flutter/material.dart'; -import 'package:gradient_widgets/gradient_widgets.dart'; -import 'package:pimp_my_button/pimp_my_button.dart'; -import 'package:violet/locale/locale.dart'; -import 'package:violet/pages/main/card/update_card.dart'; -import 'package:violet/pages/main/patchnote/patchnote_page.dart'; -import 'package:violet/pages/segment/platform_navigator.dart'; - -class UpdateLogCard extends StatefulWidget { - const UpdateLogCard({Key? key}) : super(key: key); - - @override - State createState() => _UpdateLogCardState(); -} - -class _UpdateLogCardState extends State - with TickerProviderStateMixin { - bool pressed = false; - - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - final double width = MediaQuery.of(context).size.width; - return SizedBox( - width: width - 16, - height: 75, - child: PimpedButton( - particle: MyRectangle2DemoParticle(), - pimpedWidgetBuilder: (context, controller) { - return Parent( - style: settingsItemStyle(pressed), - gesture: Gestures() - ..isTap((isTapped) async { - setState(() => pressed = isTapped); - if (!isTapped) { - controller!.forward(from: 0.0); - - PlatformNavigator.navigateSlide( - context, const PatchNotePage()); - } - }), - child: Container( - height: 75, - decoration: BoxDecoration( - // color: Color(0xff00D99E), - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - blurRadius: 8, - offset: const Offset(0, 8), - color: Gradients.taitanum.colors.first.withOpacity(.3), - spreadRadius: -9, - ), - ], - ), - child: GradientCard( - gradient: Gradients.taitanum, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - Translations.instance!.trans('patchnote'), - style: const TextStyle(color: Colors.white), - ), - ]), - ), - )); - }, - ), - ); - } - - ParentStyle settingsItemStyle(bool pressed) => ParentStyle() - ..elevation(pressed ? 0 : 10000, color: Colors.transparent) - ..scale(pressed ? 0.95 : 1.0) - ..alignmentContent.center() - // ..height(70) - // ..margin(vertical: 10) - // ..borderRadius(all: 15) - // ..background.hex('#ffffff') - ..ripple(true) - ..animate(150, Curves.easeOut); - - ParentStyle settingsItemIconStyle(Color color) => ParentStyle() - ..background.color(color) - ..margin(left: 15) - ..padding(all: 12) - ..borderRadius(all: 30); - - final TxtStyle itemTitleTextStyle = TxtStyle() - ..bold() - ..fontSize(16); - - final TxtStyle itemDescriptionTextStyle = TxtStyle() - ..textColor(Colors.black26) - ..bold() - ..fontSize(12); -} - - */ diff --git a/violet/lib/pages/main/card/views_card.dart b/violet/lib/pages/main/card/views_card.dart deleted file mode 100644 index 721ab0760..000000000 --- a/violet/lib/pages/main/card/views_card.dart +++ /dev/null @@ -1,137 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. - -/* - -import 'package:division/division.dart'; -import 'package:flutter/material.dart'; -import 'package:gradient_widgets/gradient_widgets.dart'; -import 'package:pimp_my_button/pimp_my_button.dart'; -import 'package:violet/locale/locale.dart'; -import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/main/card/update_card.dart'; -import 'package:violet/pages/main/views/views_page.dart'; -import 'package:violet/pages/segment/platform_navigator.dart'; -import 'package:violet/settings/settings.dart'; - -class ViewsCard extends StatefulWidget { - const ViewsCard({Key? key}) : super(key: key); - - @override - State createState() => _ViewsCardState(); -} - -class _ViewsCardState extends State with TickerProviderStateMixin { - bool pressed = false; - - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - final double width = MediaQuery.of(context).size.width; - return SizedBox( - width: width - 16, - height: 75, - child: PimpedButton( - particle: MyRectangle2DemoParticle(), - pimpedWidgetBuilder: (context, controller) { - return Parent( - style: settingsItemStyle(pressed), - gesture: Gestures() - ..isTap((isTapped) async { - setState(() => pressed = isTapped); - if (!isTapped) { - controller!.forward(from: 0.0); - - if (!Settings.useVioletServer) { - await showOkDialog(context, - 'To use this feature, turn on the Violet Server feature in Settings'); - return; - } - - PlatformNavigator.navigateSlide(context, const ViewsPage()); - } - }), - child: Container( - height: 75, - decoration: BoxDecoration( - // color: Color(0xff00D99E), - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - blurRadius: 8, - offset: const Offset(0, 8), - color: - Gradients.cosmicFusion.colors.first.withOpacity(.3), - spreadRadius: -9, - ), - ], - ), - child: GradientCard( - gradient: Gradients.cosmicFusion, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // SizedBox( - // width: 50, - // height: 50, - // child: Transform.translate( - // offset: Offset(-20, 0), - // child: Transform.scale( - // scale: 1.3, - // child: Center( - // child: Lottie.asset( - // 'assets/lottie/5040-shooting-star.json', - // ), - // ), - // ), - // ), - // // Icon( - // // MdiIcons.group, - // // color: Colors.white, - // // size: 30, - // // ), - // ), - Text( - Translations.instance!.trans('realtimebest'), - style: const TextStyle(color: Colors.white), - ), - ]), - ), - )); - }, - ), - ); - } - - ParentStyle settingsItemStyle(bool pressed) => ParentStyle() - ..elevation(pressed ? 0 : 10000, color: Colors.transparent) - ..scale(pressed ? 0.95 : 1.0) - ..alignmentContent.center() - // ..height(70) - // ..margin(vertical: 10) - // ..borderRadius(all: 15) - // ..background.hex('#ffffff') - ..ripple(true) - ..animate(150, Curves.easeOut); - - ParentStyle settingsItemIconStyle(Color color) => ParentStyle() - ..background.color(color) - ..margin(left: 15) - ..padding(all: 12) - ..borderRadius(all: 30); - - final TxtStyle itemTitleTextStyle = TxtStyle() - ..bold() - ..fontSize(16); - - final TxtStyle itemDescriptionTextStyle = TxtStyle() - ..textColor(Colors.black26) - ..bold() - ..fontSize(12); -} - - */ diff --git a/violet/lib/pages/main/info/violet_page.dart b/violet/lib/pages/main/info/violet_page.dart deleted file mode 100644 index 0f584beea..000000000 --- a/violet/lib/pages/main/info/violet_page.dart +++ /dev/null @@ -1,73 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020. violet-team. Licensed under the MIT License. - -import 'package:flutter/material.dart'; -import 'package:violet/settings/settings.dart'; -import 'package:violet/version/update_sync.dart'; - -class VioletPage extends StatelessWidget { - const VioletPage({super.key}); - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Container( - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(1)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - spreadRadius: 1, - blurRadius: 1, - offset: const Offset(0, 3), // changes position of shadow - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Card( - color: Settings.themeWhat - ? Colors.black.withOpacity(0.9) - : Colors.white.withOpacity(0.9), - elevation: 10, - child: SizedBox( - child: Container( - padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), - width: 250, - height: 190, - child: const Column( - children: [ - Text(''), - Text( - 'Violet', - style: TextStyle(fontSize: 30), - ), - Text( - '${UpdateSyncManager.majorVersion}.${UpdateSyncManager.minorVersion}.${UpdateSyncManager.patchVersion}', - style: TextStyle(fontSize: 20), - ), - Text(''), - // Text('Project-Violet Android App'), - Text( - 'Violet은 강력한 검색기능 및 분석기능을 통해 사용자에게 다양한 경험을 제공하는 뷰어입니다.' - ' Violet이 제공하는 편리하고도 강력한 기능들을 체험해보세요!', - // Translations.instance!.trans('infomessage'), - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11), - ), - ], - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/violet/lib/pages/main/main_page.dart b/violet/lib/pages/main/main_page.dart deleted file mode 100644 index 3e7f94a81..000000000 --- a/violet/lib/pages/main/main_page.dart +++ /dev/null @@ -1,790 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. - -import 'dart:convert'; -import 'dart:io'; -import 'dart:isolate'; -import 'dart:ui'; - -import 'package:badges/badges.dart' as badges; -import 'package:carousel_slider/carousel_slider.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_downloader/flutter_downloader.dart'; // @dependent: android -import 'package:intl/intl.dart'; -import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; -import 'package:open_file/open_file.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:sqflite/sqflite.dart'; -import 'package:violet/component/hitomi/hitomi.dart'; -import 'package:violet/component/hitomi/indexes.dart'; -import 'package:violet/database/database.dart'; -import 'package:violet/database/user/bookmark.dart'; -import 'package:violet/database/user/download.dart'; -import 'package:violet/database/user/record.dart'; -import 'package:violet/locale/locale.dart'; -import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/common/toast.dart'; -import 'package:violet/pages/database_download/database_download_page.dart'; -import 'package:violet/pages/main/artist_collection/artist_collection_page.dart'; -import 'package:violet/pages/main/buttons/carousel_button.dart'; -import 'package:violet/pages/main/info/info_page.dart'; -import 'package:violet/pages/main/info/lab/global_comments.dart'; -import 'package:violet/pages/main/info/lab/recent_record_u.dart'; -import 'package:violet/pages/main/info/lab/search_message.dart'; -import 'package:violet/pages/main/patchnote/patchnote_page.dart'; -import 'package:violet/pages/main/views/views_page.dart'; -import 'package:violet/pages/segment/double_tap_to_top.dart'; -import 'package:violet/pages/segment/platform_navigator.dart'; -import 'package:violet/pages/splash/splash_page.dart'; -import 'package:violet/platform/android_external_storage_directory.dart'; -import 'package:violet/settings/settings.dart'; -import 'package:violet/style/palette.dart'; -import 'package:violet/version/sync.dart'; -import 'package:violet/version/update_sync.dart'; -import 'package:violet/widgets/theme_switchable_state.dart'; - -final _discordUri = Uri.tryParse('https://discord.gg/K8qny6E'); -final _contactUri = Uri( - scheme: 'mailto', - path: 'violet.dev.master@gmail.com', - queryParameters: { - 'subject': '[App Issue] ', - }, -); -final _gitHubUri = Uri.tryParse('https://github.com/project-violet/'); - -class MainPage extends StatefulWidget { - const MainPage({super.key}); - - @override - State createState() => _MainPageState(); -} - -class _MainPageState extends ThemeSwitchableState - with AutomaticKeepAliveClientMixin, DoubleTapToTopMixin { - @override - bool get wantKeepAlive => true; - // int count = 0; - // bool ee = false; - int _current = 0; - - @override - VoidCallback? get shouldReloadCallback => null; - - /* - @override - void initState() { - super.initState(); - - // Future.delayed(const Duration(milliseconds: 200)).then((value) async { - // // final prefs = await SharedPreferences.getInstance(); - // // var latestDB = SyncManager.getLatestDB().getDateTime(); - // // var lastDB = prefs.getString('databasesync'); - // // if (lastDB != null && - // // latestDB.difference(DateTime.parse(lastDB)).inHours < 1) { - // // return; - // // } - - // var connectivityResult = await (Connectivity().checkConnectivity()); - // if (connectivityResult == ConnectivityResult.none) return; - - // await UpdateSyncManager.checkUpdateSync(); - - // setState(() {}); - - // // Update is not available for iOS. - // if (!Platform.isIOS) { - // updateCheckAndDownload(); // @dependent: android - // } - // }); - } - */ - - @override - Widget build(BuildContext context) { - super.build(context); - - final double statusBarHeight = MediaQuery.of(context).padding.top; - - final buttons = [ - CarouselButton( - uri: _discordUri, - backgroundColor: const Color(0xFF7189da), - icon: const Icon(MdiIcons.discord), - label: Text(Translations.instance!.trans('maindiscord')), - ), - CarouselButton( - uri: _contactUri, - backgroundColor: Colors.redAccent, - icon: const Icon(MdiIcons.gmail), - label: Text(Translations.instance!.trans('maincontact')), - ), - CarouselButton( - uri: _gitHubUri, - backgroundColor: const Color(0xFF24292E), - icon: const Icon(MdiIcons.github), - label: Text(Translations.instance!.trans('maingithub')), - ), - ]; - - final groups = [ - Container(height: 16), - _BuildGroupWidget( - name: Translations.instance!.trans('userstat'), - content: const _StatAreaWidget(), - ), - CarouselSlider( - options: CarouselOptions( - height: 70, - aspectRatio: 16 / 9, - viewportFraction: 1.0, - initialPage: 0, - enableInfiniteScroll: false, - reverse: false, - autoPlay: true, - autoPlayInterval: const Duration(seconds: 10), - autoPlayAnimationDuration: const Duration(milliseconds: 800), - autoPlayCurve: Curves.fastOutSlowIn, - enlargeCenterPage: true, - scrollDirection: Axis.horizontal, - onPageChanged: (index, reason) { - setState(() { - _current = index; - }); - }, - ), - items: [ - for (final button in buttons) - Padding( - padding: const EdgeInsets.symmetric( - vertical: 6.5, - horizontal: 32.0, - ), - child: button, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [1, 2, 3].map((url) { - int index = [1, 2, 3].indexOf(url); - return Container( - width: 8.0, - height: 8.0, - margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _current == index - ? Settings.themeWhat - ? const Color.fromRGBO(255, 255, 255, 0.9) - : const Color.fromRGBO(0, 0, 0, 0.9) - : Settings.themeWhat - ? const Color.fromRGBO(255, 255, 255, 0.4) - : const Color.fromRGBO(0, 0, 0, 0.4), - ), - ); - }).toList(), - ), - _BuildGroupWidget( - name: Translations.instance!.trans('versionmanagement'), - content: const _VersionAreaWidget(), - ), - _BuildGroupWidget( - name: Translations.instance!.trans('service'), - content: const _ServiceAreaWidget(), - ), - Container(height: 32), - ]; - - return SingleChildScrollView( - padding: EdgeInsets.only(top: statusBarHeight), - physics: const BouncingScrollPhysics(), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: groups, - ), - ); - } - - // @dependent: android [ - final ReceivePort _port = ReceivePort(); - - @pragma('vm:entry-point') - static void downloadCallback(String id, int status, int progress) { - final SendPort send = - IsolateNameServer.lookupPortByName('downloader_send_port')!; - send.send([id, status, progress]); - } - - void updateCheckAndDownload() { - bool updateContinued = false; - Future.delayed(const Duration(milliseconds: 100)).then((value) async { - if (UpdateSyncManager.updateRequire) { - var bb = await showYesNoDialog(context, - '${Translations.instance!.trans('newupdate')} ${UpdateSyncManager.updateMessage} ${Translations.instance!.trans('wouldyouupdate')}'); - if (bb == false) return; - } else { - return; - } - - if (!await Permission.manageExternalStorage.isGranted) { - if (await Permission.manageExternalStorage.request() == - PermissionStatus.denied) { - if (!mounted) return; - await showOkDialog(context, - 'If you do not allow file permissions, you cannot continue :('); - return; - } - } - updateContinued = true; - - final ext = await AndroidExternalStorageDirectory.instance - .getExternalStorageDownloadsDirectory(); - - bool once = false; - IsolateNameServer.registerPortWithName( - _port.sendPort, 'downloader_send_port'); - _port.listen((dynamic data) { - // String id = data[0]; - // DownloadTaskStatus status = data[1]; - int progress = data[2]; - print(data); - if (progress == 100 && !once) { - print('$ext/${UpdateSyncManager.updateUrl.split('/').last}'); - OpenFile.open('$ext/${UpdateSyncManager.updateUrl.split('/').last}') - .then((value) { - print(value.type); - print(value.message); - }); - once = true; - print('successs'); - } - setState(() {}); - }); - - if (await File('$ext/${UpdateSyncManager.updateUrl.split('/').last}') - .exists()) { - await File('$ext/${UpdateSyncManager.updateUrl.split('/').last}') - .delete(); - } - - FlutterDownloader.registerCallback(downloadCallback); - await FlutterDownloader.enqueue( - url: UpdateSyncManager.updateUrl, - savedDir: ext, - fileName: UpdateSyncManager.updateUrl.split('/').last, - showNotification: - true, // show download progress in status bar (for Android) - openFileFromNotification: - true, // click on notification to open downloaded file (for Android) - ); - }).then((value) async { - if (updateContinued) return; - - final prefs = await SharedPreferences.getInstance(); - if (prefs.getBool('usevioletserver_check') != null) return; - - if (!mounted) return; - var bb = await showYesNoDialog( - context, Translations.instance!.trans('violetservermsg')); - if (bb == false) { - await prefs.setBool('usevioletserver_check', false); - return; - } - - await Settings.setUseVioletServer(true); - await prefs.setBool('usevioletserver_check', false); - }); - } - - @override - void dispose() { - IsolateNameServer.removePortNameMapping('downloader_send_port'); - super.dispose(); - } - - // @dependent: android ] -} - -class _VersionAreaWidget extends StatefulWidget { - const _VersionAreaWidget(); - - @override - State<_VersionAreaWidget> createState() => _VersionAreaWidgetState(); -} - -class _VersionAreaWidgetState extends State<_VersionAreaWidget> { - bool syncAvailable = false; - - @override - void initState() { - super.initState(); - - Future.delayed(const Duration(milliseconds: 200)).then((value) async { - if (SyncManager.syncRequire) { - setState(() { - syncAvailable = true; - }); - } - }); - } - - @override - Widget build(BuildContext context) { - var versionInfo = Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text(Translations.instance!.trans('curversion'), - style: const TextStyle(color: Colors.grey)), - const Text( - ' ${UpdateSyncManager.majorVersion}.${UpdateSyncManager.minorVersion}.${UpdateSyncManager.patchVersion}'), - ], - ), - ' ${UpdateSyncManager.majorVersion}.${UpdateSyncManager.minorVersion}.${UpdateSyncManager.patchVersion}' != - ' ${UpdateSyncManager.latestVersion}' - ? Row( - children: [ - Text(Translations.instance!.trans('latestversion'), - style: const TextStyle(color: Colors.grey)), - Text(' ${UpdateSyncManager.latestVersion}'), - ], - ) - : Row( - children: [ - Text(Translations.instance!.trans('curlatestversion'), - style: const TextStyle(color: Colors.grey)), - ], - ), - ], - ), - Expanded(child: Container()), - SizedBox( - height: 40, - width: 105, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Settings.majorColor.withAlpha(220), - ), - onPressed: () { - PlatformNavigator.navigateSlide(context, const PatchNotePage()); - }, - child: Text(Translations.instance!.trans('patchnote')), - ), - ), - ], - ); - var databaseInfo = Row( - children: [ - Text(Translations.instance!.trans('database'), - style: const TextStyle(fontWeight: FontWeight.bold)), - Expanded(child: Container()), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(Translations.instance!.trans('local'), - style: const TextStyle(color: Colors.grey)), - FutureBuilder( - future: SharedPreferences.getInstance(), - builder: - (context, AsyncSnapshot snapshot) { - if (!snapshot.hasData) { - return const Text(' ??'); - } - return Text( - ' ${DateFormat('yyyy.MM.dd').format(DateTime.parse(snapshot.data!.getString('databasesync')!))}', - ); - }), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(Translations.instance!.trans('latest'), - style: const TextStyle(color: Colors.grey)), - Text( - ' ${DateFormat('yyyy.MM.dd').format(SyncManager.getLatestDB().getDateTime())}', - ), - ], - ), - ], - ), - ], - ); - return Column( - children: [ - versionInfo, - // Database - Container( - margin: const EdgeInsets.symmetric(horizontal: 0, vertical: 12.0), - width: double.infinity, - height: 1.0, - color: - Settings.themeWhat ? Colors.grey.shade600 : Colors.grey.shade400, - ), - databaseInfo, - Container(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Settings.majorColor.withAlpha(220), - ), - onPressed: () { - Navigator.of(context).pushReplacement(MaterialPageRoute( - builder: (context) => const SplashPage( - switching: true, - ))); - }, - child: - Text(' ${Translations.instance!.trans('switching')} '), - ), - badges.Badge( - showBadge: syncAvailable, - badgeContent: const Text('N', - style: TextStyle(color: Colors.white, fontSize: 12.0)), - // badgeColor: Settings.majorAccentColor, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Settings.majorColor.withAlpha(220), - ), - onPressed: _onSyncPressed, - child: Text(' ${Translations.instance!.trans('sync')} '), - ), - ), - ], - ) - ], - ); - } - - _onSyncPressed() async { - final prefs = await SharedPreferences.getInstance(); - var latestDB = SyncManager.getLatestDB().getDateTime(); - var lastDB = prefs.getString('databasesync'); - - if (lastDB != null && - latestDB.difference(DateTime.parse(lastDB)).inHours < 1) { - showToast( - level: ToastLevel.check, - message: Translations.instance!.trans('thisislatestbookmark'), - ); - return; - } - - var dir = await getApplicationDocumentsDirectory(); - - try { - await ((await openDatabase('${dir.path}/data/data.db')).close()); - await deleteDatabase('${dir.path}/data/data.db'); - if (Platform.isAndroid || Platform.isIOS) { - if (await Directory('${dir.path}/data').exists()) { - await Directory('${dir.path}/data').delete(recursive: true); - } - } - } catch (_) {} - - setState(() { - syncAvailable = false; - }); - - if (!mounted) return; - await Navigator.of(context) - .push(MaterialPageRoute( - builder: (context) => DataBaseDownloadPage( - dbType: Settings.databaseType, - isSync: true, - ))) - .then((value) async { - HitomiIndexes.init(); - final directory = await getApplicationDocumentsDirectory(); - final path = File('${directory.path}/data/index.json'); - final text = path.readAsStringSync(); - HitomiManager.tagmap = jsonDecode(text); - await DataBaseManager.reloadInstance(); - - if (!mounted) return; - showToast( - level: ToastLevel.check, - message: Translations.instance!.trans('synccomplete'), - ); - }); - } -} - -class _StatAreaWidget extends StatelessWidget { - const _StatAreaWidget(); - - String numberWithComma(int param) { - return NumberFormat('###,###,###,###').format(param).replaceAll(' ', ''); - } - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - children: [ - Text(Translations.instance!.trans('readpresent')), - Container(height: 8), - FutureBuilder(future: Future.sync( - () async { - return await (await User.getInstance()).getUserLog(); - }, - ), builder: - (context, AsyncSnapshot> snapshot) { - if (!snapshot.hasData) { - return const Text('??', - style: TextStyle( - fontFamily: 'Calibre-Semibold', fontSize: 18)); - } - return Text(numberWithComma(snapshot.data!.length), - style: const TextStyle( - fontFamily: 'Calibre-Semibold', fontSize: 18)); - }), - ], - ), - Column( - children: [ - Text(Translations.instance!.trans('bookmark')), - Container(height: 8), - FutureBuilder(future: Future.sync( - () async { - return await (await Bookmark.getInstance()).getArticle(); - }, - ), builder: - (context, AsyncSnapshot> snapshot) { - if (!snapshot.hasData) { - return const Text('??', - style: TextStyle( - fontFamily: 'Calibre-Semibold', fontSize: 18)); - } - return Text(numberWithComma(snapshot.data!.length), - style: const TextStyle( - fontFamily: 'Calibre-Semibold', fontSize: 18)); - }), - ], - ), - Column( - children: [ - Text(Translations.instance!.trans('download')), - Container(height: 8), - FutureBuilder(future: Future.sync( - () async { - return await (await Download.getInstance()) - .getDownloadItems(); - }, - ), builder: - (context, AsyncSnapshot> snapshot) { - if (!snapshot.hasData) { - return const Text('??', - style: TextStyle( - fontFamily: 'Calibre-Semibold', fontSize: 18)); - } - return Text(numberWithComma(snapshot.data!.length), - style: const TextStyle( - fontFamily: 'Calibre-Semibold', fontSize: 18)); - }), - ], - ), - ], - ) - ], - ); - } -} - -class _ServiceAreaWidget extends StatelessWidget { - const _ServiceAreaWidget(); - - @override - Widget build(BuildContext context) { - final buttonStyle = ElevatedButton.styleFrom( - foregroundColor: Colors.white, - backgroundColor: Settings.majorColor.withAlpha(220), - elevation: 3.0, - minimumSize: const Size(30.0, 30.0), - shape: const CircleBorder(), - padding: const EdgeInsets.all(16), - ); - - return Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Tooltip( - message: '작가별 모음', - child: ElevatedButton( - style: buttonStyle, - onPressed: () { - PlatformNavigator.navigateSlide( - context, const ArtistCollectionPage()); - }, - child: const Icon(MdiIcons.star), - ), - ), - Tooltip( - message: '조회수 베스트', - child: ElevatedButton( - style: buttonStyle, - onPressed: () { - PlatformNavigator.navigateSlide(context, const ViewsPage()); - }, - child: const Icon(MdiIcons.starShooting), - ), - ), - Tooltip( - message: '정보', - child: ElevatedButton( - style: buttonStyle, - onPressed: () { - PlatformNavigator.navigateSlide(context, const InfoPage()); - }, - child: const Icon(MdiIcons.heart), - ), - ), - ], - ), - Container(height: 24), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Tooltip( - message: '실시간 유저 레코드', - child: ElevatedButton( - style: buttonStyle, - onPressed: () async { - PlatformNavigator.navigateSlide( - context, const LabRecentRecordsU()); - }, - child: const Icon(MdiIcons.accessPointNetwork), - ), - ), - badges.Badge( - showBadge: true, - badgeContent: const Text('N', - style: TextStyle(color: Colors.white, fontSize: 12.0)), - child: Tooltip( - message: '댓글', - child: ElevatedButton( - style: buttonStyle, - onPressed: () async { - PlatformNavigator.navigateSlide( - context, const LabGlobalComments()); - }, - child: const Icon(MdiIcons.commentTextMultiple), - ), - ), - ), - badges.Badge( - showBadge: true, - badgeContent: const Text('N', - style: TextStyle(color: Colors.white, fontSize: 12.0)), - // badgeColor: Settings.majorAccentColor, - child: Tooltip( - message: '대사 검색기', - child: ElevatedButton( - style: buttonStyle, - onPressed: () async { - PlatformNavigator.navigateSlide( - context, const LabSearchMessage()); - }, - child: const Icon(MdiIcons.commentSearch), - ), - ), - ), - ], - ), - ], - ); - } -} - -class _BuildGroupWidget extends StatelessWidget { - final String name; - final Widget content; - - const _BuildGroupWidget({ - required this.name, - required this.content, - }); - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Container( - padding: const EdgeInsets.fromLTRB(32, 20, 32, 0), - alignment: Alignment.centerLeft, - child: Text( - name, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Settings.majorColor, - fontSize: 16.0, - ), - ), - ), - Container( - margin: const EdgeInsets.fromLTRB(32, 20, 32, 10), - // margin: EdgeInsets.only(left: 30, top: 100, right: 30, bottom: 50), - // height: double.infinity, - width: double.infinity, - decoration: !Settings.themeFlat - ? BoxDecoration( - // color: Colors.white, - color: Settings.themeWhat ? Colors.black26 : Colors.white, - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - bottomLeft: Radius.circular(8), - bottomRight: Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Settings.themeWhat - ? Colors.black26 - : Colors.grey.withOpacity(0.1), - spreadRadius: Settings.themeWhat ? 0 : 5, - blurRadius: 7, - offset: const Offset(0, 3), // changes position of shadow - ), - ], - ) - : null, - color: !Settings.themeFlat - ? null - : Settings.themeWhat - ? Settings.themeBlack - ? Palette.blackThemeBackground - : Colors.black26 - : Colors.white, - child: !Settings.themeFlat - ? ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Material( - color: Settings.themeWhat - ? Settings.themeBlack - ? Palette.blackThemeBackground - : Colors.black38 - : Colors.white, - child: Padding( - padding: const EdgeInsets.all(20.0), child: content))) - : Padding(padding: const EdgeInsets.all(20.0), child: content), - ), - ], - ); - } -} diff --git a/violet/lib/pages/main/views/views_page.dart b/violet/lib/pages/main/views/views_page.dart deleted file mode 100644 index a9504e64f..000000000 --- a/violet/lib/pages/main/views/views_page.dart +++ /dev/null @@ -1,260 +0,0 @@ -// This source code is a part of Project Violet. -// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. - -import 'package:bubble_tab_indicator/bubble_tab_indicator.dart'; -import 'package:flutter/material.dart'; -import 'package:lottie/lottie.dart'; -import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; -import 'package:provider/provider.dart'; -import 'package:uuid/uuid.dart'; -import 'package:violet/component/hitomi/hitomi.dart'; -import 'package:violet/database/query.dart'; -import 'package:violet/locale/locale.dart'; -import 'package:violet/model/article_list_item.dart'; -import 'package:violet/pages/segment/card_panel.dart'; -import 'package:violet/server/violet.dart'; -import 'package:violet/settings/settings.dart'; -import 'package:violet/widgets/article_item/article_list_item_widget.dart'; - -class ViewsPage extends StatefulWidget { - const ViewsPage({super.key}); - - @override - State createState() => _ViewsPageState(); -} - -class _ViewsPageState extends State with TickerProviderStateMixin { - @override - Widget build(BuildContext context) { - return CardPanel.build( - context, - enableBackgroundColor: true, - child: DefaultTabController( - length: 4, - child: Column( - children: [ - TabBar( - indicatorSize: TabBarIndicatorSize.tab, - indicator: BubbleTabIndicator( - indicatorHeight: 40.0, - indicatorColor: Settings.majorColor, - tabBarIndicatorSize: TabBarIndicatorSize.tab, - insets: const EdgeInsets.only(left: 8, right: 8, top: 21), - ), - tabs: [ - Container( - alignment: Alignment.center, - height: 50, - child: Column( - children: [ - Container(height: 4), - Icon(Icons.star, - color: Settings.themeWhat ? null : Colors.black), - Text(Translations.instance!.trans('daily'), - style: Settings.themeWhat - ? null - : const TextStyle(color: Colors.black)), - ], - ), - ), - Container( - alignment: Alignment.center, - height: 50, - child: Column( - children: [ - Container(height: 4), - Icon(MdiIcons.calendarWeek, - color: Settings.themeWhat ? null : Colors.black), - Text(Translations.instance!.trans('weekly'), - style: Settings.themeWhat - ? null - : const TextStyle(color: Colors.black)), - ], - ), - ), - Container( - alignment: Alignment.center, - height: 50, - child: Column( - children: [ - Container(height: 4), - Icon(MdiIcons.calendarMonth, - color: Settings.themeWhat ? null : Colors.black), - Text(Translations.instance!.trans('monthly'), - style: Settings.themeWhat - ? null - : const TextStyle(color: Colors.black)), - ], - ), - ), - Container( - alignment: Alignment.center, - height: 50, - child: Column( - children: [ - Container(height: 4), - Icon(MdiIcons.heart, - color: Settings.themeWhat ? null : Colors.black), - Text(Translations.instance!.trans('alltime'), - style: Settings.themeWhat - ? null - : const TextStyle(color: Colors.black)), - ], - ), - ), - ], - ), - const Expanded( - child: TabBarView( - children: [ - _Tab(0), - _Tab(1), - _Tab(2), - _Tab(3), - ], - ), - ), - ], - ), - ), - ); - } -} - -class _Tab extends StatefulWidget { - final int index; - - const _Tab(this.index); - - @override - State<_Tab> createState() => __TabState(); -} - -class __TabState extends State<_Tab> with AutomaticKeepAliveClientMixin { - @override - bool get wantKeepAlive => true; - - @override - Widget build(BuildContext context) { - super.build(context); - return FutureBuilder( - future: VioletServer.top( - 0, 600, ['daily', 'week', 'month', 'alltime'][widget.index]) - .then((value) async { - if (value is int) return value; - - if (value == null || value.length == 0) return 900; - - var queryRaw = - '${HitomiManager.translate2query('${Settings.includeTags} ${Settings.excludeTags.where((e) => e.trim() != '').map((e) => '-$e').join(' ')}')} AND '; - // var queryRaw = 'SELECT * FROM HitomiColumnModel WHERE '; - queryRaw += '(${value.map((e) => 'Id=${e.$1}').join(' OR ')})'; - var query = await QueryManager.query(queryRaw); - - if (query.results!.isEmpty) return 901; - - var qr = {}; - for (var element in query.results!) { - qr[element.id().toString()] = element; - } - - var result = <(QueryResult, int)>[]; - value.forEach((element) { - if (qr[element.$1.toString()] == null) { - // TODO: Handle qurey not found - return; - } - result.add((qr[element.$1.toString()]!, element.$2)); - }); - - return result; - }), - builder: (context, snapshot) { - if (!snapshot.hasData) { - return const Center( - child: CircularProgressIndicator(), - ); - } - if (snapshot.data is int) { - var errmsg = { - '400': 'Bad Request', - '403': 'Forbidden', - '429': 'Too Many Requests', - '500': 'Internal Server Error', - '502': 'Bad Gateway', - '521': 'Web server is down', - // - '900': 'Nothing To Display', - '901': 'No Query Results.', - }; - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 150, - height: 150, - child: Lottie.asset( - 'assets/lottie/3227-error-404-facebook-style.json', - ), - ), - Container(height: 16), - const Text( - 'Oops! Something was wrong!', - style: TextStyle(fontSize: 24), - ), - Container(height: 2), - const Text( - 'If you still encounter this error, please contact the developer!', - textAlign: TextAlign.center, - style: TextStyle(fontSize: 16), - ), - Text( - 'Error${errmsg[snapshot.data.toString()] != null ? ': ${errmsg[snapshot.data.toString()]!}' : ' Code: ${snapshot.data}'}') - ], - ), - ); - } - - // return ListView.builder( - // itemCount: snapshot.data.length, - // itemBuilder: (context, index) { - // return ListTile( - // title: Text( - // '${index + 1}. ' + snapshot.data[index].$1.toString()), - // subtitle: Text(snapshot.data[index].$2.toString()), - // ); - // }, - // ); - var windowWidth = MediaQuery.of(context).size.width; - - var results = snapshot.data as List<(QueryResult, int)>; - - return ListView( - physics: const BouncingScrollPhysics(), - children: results.map((x) { - return Align( - key: Key('views${widget.index}/${x.$1.id()}'), - alignment: Alignment.center, - child: Provider.value( - value: ArticleListItem.fromArticleListItem( - queryResult: x.$1, - showDetail: true, - addBottomPadding: true, - width: (windowWidth - 4.0), - thumbnailTag: const Uuid().v4(), - viewed: x.$2, - usableTabList: results.map((e) => e.$1).toList(), - // isCheckMode: checkMode, - // isChecked: checked.contains(x.id()), - ), - child: const ArticleListItemWidget(), - ), - ); - }).toList(), - ); - }, - ); - } -} diff --git a/violet/lib/pages/search/search_page.dart b/violet/lib/pages/search/search_page.dart index 0bffb9407..ca37c2ed6 100644 --- a/violet/lib/pages/search/search_page.dart +++ b/violet/lib/pages/search/search_page.dart @@ -14,7 +14,6 @@ import 'package:get/get.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; import 'package:provider/provider.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:uuid/uuid.dart'; import 'package:violet/component/hentai.dart'; import 'package:violet/component/hitomi/population.dart'; @@ -24,8 +23,7 @@ import 'package:violet/database/user/search.dart'; import 'package:violet/locale/locale.dart' as trans; import 'package:violet/log/log.dart'; import 'package:violet/model/article_list_item.dart'; -import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/main/info/lab/search_message.dart'; +import 'package:violet/pages/lab/lab/search_message.dart'; import 'package:violet/pages/search/search_bar_page.dart'; import 'package:violet/pages/search/search_page_controller.dart'; import 'package:violet/pages/search/search_page_modify.dart'; @@ -109,19 +107,9 @@ class _SearchPageState extends ThemeSwitchableState } } - welcomeMessage() async { - final prefs = await SharedPreferences.getInstance(); - - if (prefs.getBool('litemode_welcome_message') == null) { - prefs.setBool('litemode_welcome_message', true); - showOkDialog(context, '라이트 모드가 활성화되었습니다! 설정에서 라이트 모드를 끌 수 있습니다.'); - } - } - @override void didChangeDependencies() { super.didChangeDependencies(); - welcomeMessage(); c.initScroll(context); doubleTapToTopScrollController = c.scrollController; } diff --git a/violet/lib/pages/main/artist_collection/artist_collection_page.dart b/violet/lib/pages/settings/artist_collection/artist_collection_page.dart similarity index 98% rename from violet/lib/pages/main/artist_collection/artist_collection_page.dart rename to violet/lib/pages/settings/artist_collection/artist_collection_page.dart index 407e023ba..4175e4708 100644 --- a/violet/lib/pages/main/artist_collection/artist_collection_page.dart +++ b/violet/lib/pages/settings/artist_collection/artist_collection_page.dart @@ -5,7 +5,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:violet/component/hitomi/artists.dart'; import 'package:violet/locale/locale.dart'; -import 'package:violet/pages/main/artist_collection/artist_list_page.dart'; +import 'package:violet/pages/settings/artist_collection/artist_list_page.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; diff --git a/violet/lib/pages/main/artist_collection/artist_list_page.dart b/violet/lib/pages/settings/artist_collection/artist_list_page.dart similarity index 100% rename from violet/lib/pages/main/artist_collection/artist_list_page.dart rename to violet/lib/pages/settings/artist_collection/artist_list_page.dart diff --git a/violet/lib/pages/settings/bookmark_version_select.dart b/violet/lib/pages/settings/bookmark_version_select.dart index c3f06d1b5..bf808a436 100644 --- a/violet/lib/pages/settings/bookmark_version_select.dart +++ b/violet/lib/pages/settings/bookmark_version_select.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; import 'package:timeago/timeago.dart' as timeago; import 'package:violet/locale/locale.dart'; import 'package:violet/other/dialogs.dart'; -import 'package:violet/pages/main/info/lab/bookmark/bookmarks.dart'; +import 'package:violet/pages/lab/lab/bookmark/bookmarks.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/settings/settings.dart'; diff --git a/violet/lib/pages/main/faq/faq_page.dart b/violet/lib/pages/settings/faq_page.dart similarity index 100% rename from violet/lib/pages/main/faq/faq_page.dart rename to violet/lib/pages/settings/faq_page.dart diff --git a/violet/lib/pages/main/info/info_page.dart b/violet/lib/pages/settings/info_page.dart similarity index 96% rename from violet/lib/pages/main/info/info_page.dart rename to violet/lib/pages/settings/info_page.dart index 81c5cffc7..c990fcaf1 100644 --- a/violet/lib/pages/main/info/info_page.dart +++ b/violet/lib/pages/settings/info_page.dart @@ -4,12 +4,12 @@ import 'package:flutter/material.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:violet/pages/main/faq/faq_page.dart'; -import 'package:violet/pages/main/info/lab_page.dart'; -import 'package:violet/pages/main/info/user_manual_page.dart'; -import 'package:violet/pages/main/info/violet_page.dart'; +import 'package:violet/pages/settings/faq_page.dart'; +import 'package:violet/pages/lab/lab_page.dart'; +import 'package:violet/pages/settings/user_manual_page.dart'; import 'package:violet/pages/segment/card_panel.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; +import 'package:violet/pages/settings/version_page.dart'; import 'package:violet/settings/settings.dart'; import 'package:violet/style/palette.dart'; @@ -50,7 +50,7 @@ class _InfoPageState extends State { await showDialog( context: context, builder: (BuildContext context) { - return const VioletPage(); + return const VersionViewPage(); }, ); }, diff --git a/violet/lib/pages/main/patchnote/patchnote_page.dart b/violet/lib/pages/settings/patchnote_page.dart similarity index 100% rename from violet/lib/pages/main/patchnote/patchnote_page.dart rename to violet/lib/pages/settings/patchnote_page.dart diff --git a/violet/lib/pages/settings/settings_page.dart b/violet/lib/pages/settings/settings_page.dart index 7a2404136..f9d950a54 100644 --- a/violet/lib/pages/settings/settings_page.dart +++ b/violet/lib/pages/settings/settings_page.dart @@ -40,13 +40,13 @@ import 'package:violet/pages/after_loading/afterloading_page.dart'; import 'package:violet/pages/common/toast.dart'; import 'package:violet/pages/community/user_status_card.dart'; import 'package:violet/pages/database_download/database_download_page.dart'; -import 'package:violet/pages/main/artist_collection/artist_collection_page.dart'; -import 'package:violet/pages/main/faq/faq_page.dart'; -import 'package:violet/pages/main/info/lab/global_comments.dart'; -import 'package:violet/pages/main/info/lab/recent_record_u.dart'; -import 'package:violet/pages/main/info/lab_page.dart'; -import 'package:violet/pages/main/info/user_manual_page.dart'; -import 'package:violet/pages/main/patchnote/patchnote_page.dart'; +import 'package:violet/pages/settings/artist_collection/artist_collection_page.dart'; +import 'package:violet/pages/settings/faq_page.dart'; +import 'package:violet/pages/lab/lab/global_comments.dart'; +import 'package:violet/pages/lab/lab/recent_record_u.dart'; +import 'package:violet/pages/lab/lab_page.dart'; +import 'package:violet/pages/settings/user_manual_page.dart'; +import 'package:violet/pages/settings/patchnote_page.dart'; import 'package:violet/pages/segment/double_tap_to_top.dart'; import 'package:violet/pages/segment/platform_navigator.dart'; import 'package:violet/pages/settings/bookmark_version_select.dart'; @@ -101,8 +101,8 @@ class _SettingsPageState extends State if (_cachedGroups == null || _shouldReload) { _shouldReload = false; _cachedGroups = _themeGroup() - ..addAll(!Settings.liteMode ? [const UserStatusCard()] : []) - ..addAll(!Settings.liteMode ? [] : _communityGroup()) + ..addAll([const UserStatusCard()]) + ..addAll(_communityGroup()) ..addAll(_searchGroup()) ..addAll(_systemGroup()) ..addAll(_securityGroup()) @@ -364,30 +364,29 @@ class _SettingsPageState extends State ), ), ), - if (!Settings.liteMode) - InkWell( - child: ListTile( - leading: Icon(Mdi.buffer, color: Settings.majorColor), - title: Text(Translations.instance!.trans('useflattheme')), - trailing: Switch( - value: Settings.themeFlat, - onChanged: (newValue) async { - await Settings.setThemeFlat(newValue); - setState(() { - _shouldReload = true; - }); - }, - activeTrackColor: Settings.majorColor, - activeColor: Settings.majorAccentColor, - ), + InkWell( + child: ListTile( + leading: Icon(Mdi.buffer, color: Settings.majorColor), + title: Text(Translations.instance!.trans('useflattheme')), + trailing: Switch( + value: Settings.themeFlat, + onChanged: (newValue) async { + await Settings.setThemeFlat(newValue); + setState(() { + _shouldReload = true; + }); + }, + activeTrackColor: Settings.majorColor, + activeColor: Settings.majorAccentColor, ), - onTap: () async { - await Settings.setThemeFlat(!Settings.themeFlat); - setState(() { - _shouldReload = true; - }); - }, ), + onTap: () async { + await Settings.setThemeFlat(!Settings.themeFlat); + setState(() { + _shouldReload = true; + }); + }, + ), InkWell( child: ListTile( leading: Icon(MdiIcons.tabletDashboard, color: Settings.majorColor), @@ -411,54 +410,18 @@ class _SettingsPageState extends State }); }, ), - if (!Settings.liteMode) - InkWell( - child: ListTile( - leading: Icon(MdiIcons.cellphoneText, color: Settings.majorColor), - title: Text(Translations.instance!.trans('userdrawer')), - trailing: Switch( - value: Settings.useDrawer, - onChanged: (newValue) async { - await Settings.setUseDrawer(newValue); - setState(() { - _shouldReload = true; - }); - - final afterLoadingPageState = - context.findAncestorStateOfType(); - afterLoadingPageState!.setState(() { - _shouldReload = true; - }); - }, - activeTrackColor: Settings.majorColor, - activeColor: Settings.majorAccentColor, - ), - ), - onTap: () async { - await Settings.setUseDrawer(!Settings.useDrawer); - setState(() { - _shouldReload = true; - }); - - final afterLoadingPageState = - context.findAncestorStateOfType(); - afterLoadingPageState!.setState(() { - _shouldReload = true; - }); - }, - ), InkWell( customBorder: const RoundedRectangleBorder( borderRadius: BorderRadius.only( bottomLeft: Radius.circular(8.0), bottomRight: Radius.circular(8.0))), child: ListTile( - leading: Icon(MdiIcons.feather, color: Settings.majorColor), - title: Text(Translations.instance!.trans('litemode')), + leading: Icon(MdiIcons.cellphoneText, color: Settings.majorColor), + title: Text(Translations.instance!.trans('userdrawer')), trailing: Switch( - value: Settings.liteMode, + value: Settings.useDrawer, onChanged: (newValue) async { - await Settings.setLightMode(newValue); + await Settings.setUseDrawer(newValue); setState(() { _shouldReload = true; }); @@ -474,7 +437,7 @@ class _SettingsPageState extends State ), ), onTap: () async { - await Settings.setLightMode(!Settings.liteMode); + await Settings.setUseDrawer(!Settings.useDrawer); setState(() { _shouldReload = true; }); @@ -661,59 +624,57 @@ class _SettingsPageState extends State } }, ), - if (!Settings.liteMode) - ListTile( - leading: Icon( - MdiIcons.tooltipEdit, - color: Settings.majorColor, - ), - title: Text(Translations.instance!.trans('tagrebuild')), - trailing: const Icon(Icons.keyboard_arrow_right), - onTap: () async { - if (await showYesNoDialog( - context, - Translations.instance!.trans('tagrebuildmsg'), - Translations.instance!.trans('tagrebuild'))) { - await showDialog( - context: context, - builder: (BuildContext context) => const TagRebuildPage(), - ); + ListTile( + leading: Icon( + MdiIcons.tooltipEdit, + color: Settings.majorColor, + ), + title: Text(Translations.instance!.trans('tagrebuild')), + trailing: const Icon(Icons.keyboard_arrow_right), + onTap: () async { + if (await showYesNoDialog( + context, + Translations.instance!.trans('tagrebuildmsg'), + Translations.instance!.trans('tagrebuild'))) { + await showDialog( + context: context, + builder: (BuildContext context) => const TagRebuildPage(), + ); - await HitomiIndexes.init(); - HitomiManager.reloadIndex(); + await HitomiIndexes.init(); + HitomiManager.reloadIndex(); - showToast( - level: ToastLevel.check, - message: - '${Translations.instance!.trans('tagrebuild')} ${Translations.instance!.trans('complete')}', - ); - } - }, - ), - if (!Settings.liteMode) - InkWell( - child: ListTile( - leading: Icon(Mdi.compassOutline, color: Settings.majorColor), - title: const Text('Pure Search'), - trailing: Switch( - value: Settings.searchPure, - onChanged: (newValue) async { - await Settings.setSearchPure(newValue); - setState(() { - _shouldReload = true; - }); - }, - activeTrackColor: Settings.majorColor, - activeColor: Settings.majorAccentColor, - ), + showToast( + level: ToastLevel.check, + message: + '${Translations.instance!.trans('tagrebuild')} ${Translations.instance!.trans('complete')}', + ); + } + }, + ), + InkWell( + child: ListTile( + leading: Icon(Mdi.compassOutline, color: Settings.majorColor), + title: const Text('Pure Search'), + trailing: Switch( + value: Settings.searchPure, + onChanged: (newValue) async { + await Settings.setSearchPure(newValue); + setState(() { + _shouldReload = true; + }); + }, + activeTrackColor: Settings.majorColor, + activeColor: Settings.majorAccentColor, ), - onTap: () async { - await Settings.setSearchPure(!Settings.searchPure); - setState(() { - _shouldReload = true; - }); - }, ), + onTap: () async { + await Settings.setSearchPure(!Settings.searchPure); + setState(() { + _shouldReload = true; + }); + }, + ), InkWell( customBorder: const RoundedRectangleBorder( borderRadius: BorderRadius.only( @@ -1019,42 +980,41 @@ class _SettingsPageState extends State }); }, ), - if (!Settings.liteMode) - ListTile( - leading: Icon(Mdi.tableArrowRight, color: Settings.majorColor), - title: Text(Translations.instance!.trans('exportlog')), - trailing: const Icon(Icons.keyboard_arrow_right), - onTap: () async { - final ext = Platform.isIOS - ? await getApplicationSupportDirectory() - : await getExternalStorageDirectory(); - final logfile = File('${ext!.path}/log.txt'); - - if (Platform.isAndroid) { - await PlatformMiscMethods.instance.exportFile( - logfile.path, - mimeType: 'application/txt', - fileNameToSaveAs: 'log.txt', - ); - } else { - final selectedPath = - await FilePicker.platform.getDirectoryPath(); - - if (selectedPath == null) { - return; - } + ListTile( + leading: Icon(Mdi.tableArrowRight, color: Settings.majorColor), + title: Text(Translations.instance!.trans('exportlog')), + trailing: const Icon(Icons.keyboard_arrow_right), + onTap: () async { + final ext = Platform.isIOS + ? await getApplicationSupportDirectory() + : await getExternalStorageDirectory(); + final logfile = File('${ext!.path}/log.txt'); - final extpath = '$selectedPath/bookmark.db'; + if (Platform.isAndroid) { + await PlatformMiscMethods.instance.exportFile( + logfile.path, + mimeType: 'application/txt', + fileNameToSaveAs: 'log.txt', + ); + } else { + final selectedPath = + await FilePicker.platform.getDirectoryPath(); - await logfile.copy(extpath); + if (selectedPath == null) { + return; } - showToast( - level: ToastLevel.check, - message: Translations.instance!.trans('complete'), - ); - }, - ), + final extpath = '$selectedPath/bookmark.db'; + + await logfile.copy(extpath); + } + + showToast( + level: ToastLevel.check, + message: Translations.instance!.trans('complete'), + ); + }, + ), ListTile( leading: Icon(Icons.info_outline, color: Settings.majorColor), title: Text(Translations.instance!.trans('info')), @@ -1827,133 +1787,131 @@ class _SettingsPageState extends State ), ), ), - if (!Settings.liteMode) - ListTile( - leading: Icon( - MdiIcons.bookArrowDownOutline, - color: Settings.majorColor, - ), - title: Text(Translations.instance!.trans('restoringbookmark')), - trailing: const Icon(Icons.keyboard_arrow_right), - onTap: () async { - await showOkDialog( - context, - Translations.instance!.trans('restorebookmarkmsg'), - Translations.instance!.trans('warning')); + ListTile( + leading: Icon( + MdiIcons.bookArrowDownOutline, + color: Settings.majorColor, + ), + title: Text(Translations.instance!.trans('restoringbookmark')), + trailing: const Icon(Icons.keyboard_arrow_right), + onTap: () async { + await showOkDialog( + context, + Translations.instance!.trans('restorebookmarkmsg'), + Translations.instance!.trans('warning')); - final prefs = await SharedPreferences.getInstance(); - var myappid = prefs.getString('fa_userid'); + final prefs = await SharedPreferences.getInstance(); + var myappid = prefs.getString('fa_userid'); - // 1. 북마크 유저 아이디 선택 - TextEditingController text = - TextEditingController(text: myappid); - Widget okButton = TextButton( - style: TextButton.styleFrom( - foregroundColor: Settings.majorColor), - child: Text(Translations.instance!.trans('ok')), - onPressed: () { - Navigator.pop(context, true); - }, - ); - Widget cancelButton = TextButton( - style: TextButton.styleFrom( - foregroundColor: Settings.majorColor), - child: Text(Translations.instance!.trans('cancel')), - onPressed: () { - Navigator.pop(context, false); - }, - ); - var dialog = await showDialog( - useRootNavigator: false, - context: context, - builder: (BuildContext context) => AlertDialog( - contentPadding: const EdgeInsets.fromLTRB(12, 0, 12, 0), - title: const Text('Enter User App Id'), - content: TextField( - controller: text, - autofocus: true, - maxLines: 3, - ), - actions: [okButton, cancelButton], + // 1. 북마크 유저 아이디 선택 + TextEditingController text = TextEditingController(text: myappid); + Widget okButton = TextButton( + style: + TextButton.styleFrom(foregroundColor: Settings.majorColor), + child: Text(Translations.instance!.trans('ok')), + onPressed: () { + Navigator.pop(context, true); + }, + ); + Widget cancelButton = TextButton( + style: + TextButton.styleFrom(foregroundColor: Settings.majorColor), + child: Text(Translations.instance!.trans('cancel')), + onPressed: () { + Navigator.pop(context, false); + }, + ); + var dialog = await showDialog( + useRootNavigator: false, + context: context, + builder: (BuildContext context) => AlertDialog( + contentPadding: const EdgeInsets.fromLTRB(12, 0, 12, 0), + title: const Text('Enter User App Id'), + content: TextField( + controller: text, + autofocus: true, + maxLines: 3, ), - ); - if (dialog == null || dialog == false) { - // await Settings.setDownloadRule(text.text); + actions: [okButton, cancelButton], + ), + ); + if (dialog == null || dialog == false) { + // await Settings.setDownloadRule(text.text); + return; + } + + try { + // 2. 유효한 유저 아이디 인지 확인(서버 요청 및 다운로드) + var result = await VioletServer.restoreBookmark(text.text); + if (result == null) { + await showOkDialog( + context, + "Invalid User-App-Id! If you're still getting this error, contact the developer.", + Translations.instance!.trans('restoringbookmark')); return; } - try { - // 2. 유효한 유저 아이디 인지 확인(서버 요청 및 다운로드) - var result = await VioletServer.restoreBookmark(text.text); - if (result == null) { - await showOkDialog( - context, - "Invalid User-App-Id! If you're still getting this error, contact the developer.", - Translations.instance!.trans('restoringbookmark')); - return; - } - - // 3. 북마크 버전 가져오기 - var versions = await VioletServer.versionsBookmark(text.text); - if (versions == null) { - await showOkDialog( - context, - '북마크 버전 정보를 가져오는데 오류가 발생했습니다. UserAppId와 함께 개발자에게 문의하시기 바랍니다.', - Translations.instance!.trans('restoringbookmark')); - return; - } + // 3. 북마크 버전 가져오기 + var versions = await VioletServer.versionsBookmark(text.text); + if (versions == null) { + await showOkDialog( + context, + '북마크 버전 정보를 가져오는데 오류가 발생했습니다. UserAppId와 함께 개발자에게 문의하시기 바랍니다.', + Translations.instance!.trans('restoringbookmark')); + return; + } - // 4. 버전 선택 및 북마크 확인 (이 북마크를 복원할까요?) - var version = await PlatformNavigator.navigateSlide( - context, - BookmarkVersionSelectPage( - userAppId: text.text, - versions: versions, - ), - ); + // 4. 버전 선택 및 북마크 확인 (이 북마크를 복원할까요?) + var version = await PlatformNavigator.navigateSlide( + context, + BookmarkVersionSelectPage( + userAppId: text.text, + versions: versions, + ), + ); - if (version == null) { - return; - } + if (version == null) { + return; + } - // 5. 열람기록도 같이 복원할까요? - var restoreWithRecord = - await showYesNoDialog(context, '열람기록도 같이 복원할까요?'); + // 5. 열람기록도 같이 복원할까요? + var restoreWithRecord = + await showYesNoDialog(context, '열람기록도 같이 복원할까요?'); - // 6. 북마크 다운로드 - var bookmark = await VioletServer.resotreBookmarkWithVersion( - text.text, version); + // 6. 북마크 다운로드 + var bookmark = await VioletServer.resotreBookmarkWithVersion( + text.text, version); - // 7. 덮어쓰기 한다. - var rr = await showDialog( - context: context, - builder: (BuildContext context) => RestoreBookmarkPage( - source: bookmark, - restoreWithRecord: restoreWithRecord, - ), - ); + // 7. 덮어쓰기 한다. + var rr = await showDialog( + context: context, + builder: (BuildContext context) => RestoreBookmarkPage( + source: bookmark, + restoreWithRecord: restoreWithRecord, + ), + ); - if (rr != null && rr == false) { - return; - } - } catch (e, st) { - Logger.error('[Restore Bookmark] $e\n' - '$st'); - showToast( - level: ToastLevel.error, - message: 'Bookmark Restoring Error!', - ); + if (rr != null && rr == false) { return; } - - await Bookmark.getInstance(); - + } catch (e, st) { + Logger.error('[Restore Bookmark] $e\n' + '$st'); showToast( - level: ToastLevel.check, - message: Translations.instance!.trans('importbookmark'), + level: ToastLevel.error, + message: 'Bookmark Restoring Error!', ); - }, - ), + return; + } + + await Bookmark.getInstance(); + + showToast( + level: ToastLevel.check, + message: Translations.instance!.trans('importbookmark'), + ); + }, + ), ListTile( leading: Icon(MdiIcons.import, color: Settings.majorColor), title: Text(Translations.instance!.trans('importingbookmark')), @@ -2525,85 +2483,60 @@ class _SettingsPageState extends State SettingGroupName(name: Translations.instance!.trans('etc')), _buildItems( [ - if (!Settings.liteMode) - InkWell( - customBorder: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8.0), - topRight: Radius.circular(8.0))), - child: ListTile( - leading: const Icon( - MdiIcons.discord, - color: Color(0xFF7189da), - ), - title: Text(Translations.instance!.trans('discord')), - trailing: const Icon(Icons.open_in_new), - ), - onTap: () async { - final url = Uri.parse('https://discord.gg/K8qny6E'); - if (await canLaunchUrl(url)) { - await launchUrl(url); - } - }, - ), - if (!Settings.liteMode) - ListTile( + InkWell( + customBorder: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8.0), + topRight: Radius.circular(8.0))), + child: ListTile( leading: const Icon( - MdiIcons.github, - color: Colors.black, + MdiIcons.discord, + color: Color(0xFF7189da), ), - title: Text('GitHub ${Translations.instance!.trans('project')}'), + title: Text(Translations.instance!.trans('discord')), trailing: const Icon(Icons.open_in_new), - onTap: () async { - final url = Uri.parse('https://github.com/project-violet/'); - if (await canLaunchUrl(url)) { - await launchUrl(url); - } - }, - ) - else - InkWell( - customBorder: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8.0), - topRight: Radius.circular(8.0))), - child: ListTile( - leading: const Icon( - MdiIcons.github, - color: Colors.black, - ), - title: - Text('GitHub ${Translations.instance!.trans('project')}'), - trailing: const Icon(Icons.open_in_new), - ), - onTap: () async { - final url = Uri.parse('https://github.com/project-violet/'); - if (await canLaunchUrl(url)) { - await launchUrl(url); - } - }, ), - if (!Settings.liteMode) - ListTile( - leading: const Icon( - MdiIcons.gmail, - color: Colors.redAccent, - ), - title: Text(Translations.instance!.trans('contact')), - trailing: const Icon(Icons.keyboard_arrow_right), - onTap: () async { - final url = Uri( - scheme: 'mailto', - path: 'violet.dev.master@gmail.com', - queryParameters: { - 'subject': '[App Issue] ', - }, - ); - if (await canLaunchUrl(url)) { - await launchUrl(url); - } - }, + onTap: () async { + final url = Uri.parse('https://discord.gg/K8qny6E'); + if (await canLaunchUrl(url)) { + await launchUrl(url); + } + }, + ), + ListTile( + leading: const Icon( + MdiIcons.github, + color: Colors.black, + ), + title: Text('GitHub ${Translations.instance!.trans('project')}'), + trailing: const Icon(Icons.open_in_new), + onTap: () async { + final url = Uri.parse('https://github.com/project-violet/'); + if (await canLaunchUrl(url)) { + await launchUrl(url); + } + }, + ), + ListTile( + leading: const Icon( + MdiIcons.gmail, + color: Colors.redAccent, ), + title: Text(Translations.instance!.trans('contact')), + trailing: const Icon(Icons.keyboard_arrow_right), + onTap: () async { + final url = Uri( + scheme: 'mailto', + path: 'violet.dev.master@gmail.com', + queryParameters: { + 'subject': '[App Issue] ', + }, + ); + if (await canLaunchUrl(url)) { + await launchUrl(url); + } + }, + ), ListTile( leading: const Icon( MdiIcons.heart, diff --git a/violet/lib/pages/main/info/user_manual_page.dart b/violet/lib/pages/settings/user_manual_page.dart similarity index 100% rename from violet/lib/pages/main/info/user_manual_page.dart rename to violet/lib/pages/settings/user_manual_page.dart diff --git a/violet/lib/settings/settings.dart b/violet/lib/settings/settings.dart index cd2924a33..21318a537 100644 --- a/violet/lib/settings/settings.dart +++ b/violet/lib/settings/settings.dart @@ -38,7 +38,6 @@ class Settings { static late bool themeFlat; static late bool themeBlack; // default false static late bool useTabletMode; - static late bool liteMode; // Tag Settings static late String includeTags; @@ -137,8 +136,6 @@ class Settings { themeFlat = await _getBool('themeFlat'); themeBlack = await _getBool('themeBlack'); - liteMode = await _getBool('liteMode', true); - language = prefs.getString('language'); useLockScreen = await _getBool('useLockScreen'); @@ -889,12 +886,6 @@ class Settings { await prefs.setBool('useSecureMode', nn); } - - static Future setLightMode(bool nn) async { - liteMode = nn; - - await prefs.setBool('liteMode', nn); - } } enum SearchResultType { diff --git a/violet/lib/widgets/article_item/article_list_item_widget.dart b/violet/lib/widgets/article_item/article_list_item_widget.dart index 34fa08180..d50dbb9d4 100644 --- a/violet/lib/widgets/article_item/article_list_item_widget.dart +++ b/violet/lib/widgets/article_item/article_list_item_widget.dart @@ -241,11 +241,7 @@ class _ArticleListItemWidgetState extends State _animateScale(1.0); - if (!Settings.liteMode) { - _showArticleInfo(); - } else { - _showArticleInfo(); - } + _showArticleInfo(); } Future _showArticleInfo() async { @@ -437,11 +433,7 @@ class _ArticleListItemWidgetState extends State } Future _onDoubleTap() async { - if (!Settings.liteMode) { - _showThumbnailView(); - } else { - _showThumbnailView(); - } + _showThumbnailView(); } _showThumbnailView() async {