Skip to content

Commit

Permalink
Merge pull request #576 from project-violet/remove-main
Browse files Browse the repository at this point in the history
Refactor 009: Remove main page
  • Loading branch information
violet-dev authored Oct 29, 2024
2 parents 7e4f4a7 + ef93850 commit 5e50cbc
Show file tree
Hide file tree
Showing 52 changed files with 313 additions and 2,174 deletions.
1 change: 0 additions & 1 deletion violet/assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"aligngroup": "그룹 순으로 정렬",
"alignpage": "페이지수순으로 정렬",
"alignrecentread": "최근 읽은 순으로 정렬",
"litemode": "라이트 모드",
"hot": "인기",
"faq": "자주 묻는 질문",
"usermanual": "유저 메뉴얼",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/zh_Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion violet/assets/locale/zh_Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
23 changes: 9 additions & 14 deletions violet/lib/pages/after_loading/afterloading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -117,7 +116,7 @@ class AfterLoadingPageState extends State<AfterLoadingPage>
bool _isDoubleTap = false;

late final List<GlobalKey<State>> _widgetKeys =
List.generate(7, (index) => GlobalKey());
List.generate(5, (index) => GlobalKey());

Widget _buildBottomNavigationBar(BuildContext context) {
final translations = Translations.instance!;
Expand Down Expand Up @@ -159,7 +158,6 @@ class AfterLoadingPageState extends State<AfterLoadingPage>
} else {
if (_isDoubleTap) {
// something to do for double tap
if (index >= 2 || Settings.liteMode) index += 1;
(_widgetKeys[index].currentState as DoubleTapToTopMixin)
.animateToTop();

Expand All @@ -173,9 +171,8 @@ class AfterLoadingPageState extends State<AfterLoadingPage>
}
},
items: <BottomNavigationBarItem>[
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'),
Expand Down Expand Up @@ -281,9 +278,8 @@ class AfterLoadingPageState extends State<AfterLoadingPage>
],
),
),
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'),
Expand Down Expand Up @@ -357,12 +353,11 @@ class AfterLoadingPageState extends State<AfterLoadingPage>
setState(() {});
},
children: <Widget>[
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]),
],
),
],
Expand Down
2 changes: 1 addition & 1 deletion violet/lib/pages/article_info/article_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
68 changes: 0 additions & 68 deletions violet/lib/pages/main/buttons/carousel_button.dart

This file was deleted.

Loading

0 comments on commit 5e50cbc

Please sign in to comment.