Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/project-violet/violet into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
violet-dev committed Apr 8, 2023
2 parents fc89a64 + 4ae1264 commit 6145e1e
Show file tree
Hide file tree
Showing 30 changed files with 142 additions and 122 deletions.
1 change: 0 additions & 1 deletion lib/component/hentai.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright (C) 2020-2023. violet-team. Licensed under the Apache-2.0 License.

import 'package:shared_preferences/shared_preferences.dart';
import 'package:tuple/tuple.dart';
import 'package:violet/component/eh/eh_headers.dart';
import 'package:violet/component/eh/eh_parser.dart';
import 'package:violet/component/eh/eh_provider.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/component/hitomi/hitomi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import 'dart:convert';
import 'dart:io';

import 'package:get/get_connect/http/src/utils/utils.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'package:tuple/tuple.dart';
Expand Down
13 changes: 6 additions & 7 deletions lib/pages/article_info/article_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tuple/tuple.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:uuid/uuid.dart';
import 'package:violet/component/eh/eh_headers.dart';
import 'package:violet/component/eh/eh_parser.dart';
Expand All @@ -38,7 +38,6 @@ import 'package:violet/pages/artist_info/article_list_page.dart';
import 'package:violet/pages/artist_info/artist_info_page.dart';
import 'package:violet/pages/download/download_page.dart';
import 'package:violet/pages/main/info/lab/search_comment_author.dart';
import 'package:violet/pages/search/search_page.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 Expand Up @@ -856,8 +855,8 @@ class __InfoAreaWidgetState extends State<_InfoAreaWidget> {
var match = ehPattern.allMatches(url);
var id = match.first.namedGroup('id')!.trim();
_showArticleInfo(int.parse(id));
} else if (await canLaunch(url)) {
await launch(url);
} else if (await canLaunchUrlString(url)) {
await launchUrlString(url);
}
}

Expand Down Expand Up @@ -1004,17 +1003,17 @@ class _Chip extends StatelessWidget {
Widget build(BuildContext context) {
var tagDisplayed = name;
Color color = Colors.grey;
Color avatarBg = Colors.grey.shade600;
// Color avatarBg = Colors.grey.shade600;

if (Settings.translateTags) {
tagDisplayed =
TagTranslate.ofAny(tagDisplayed).split(':').last.split('|').first;
}

if (group == 'female') {
avatarBg = color = Colors.pink.shade400;
// avatarBg = color = Colors.pink.shade400;
} else if (group == 'male') {
avatarBg = color = Colors.blue;
// avatarBg = color = Colors.blue;
} else if (group == 'prefix') {
color = Colors.orange;
} else if (group == 'id') {
Expand Down
1 change: 0 additions & 1 deletion lib/pages/artist_info/article_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:violet/pages/artist_info/search_type2.dart';
import 'package:violet/pages/segment/filter_page.dart';
import 'package:violet/pages/segment/filter_page_controller.dart';
import 'package:violet/pages/segment/platform_navigator.dart';
import 'package:violet/settings/settings.dart';
import 'package:violet/style/palette.dart';
import 'package:violet/widgets/article_item/article_list_item_widget.dart';
import 'package:violet/widgets/search_bar.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/pages/bookmark/group/group_article_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uuid/uuid.dart';
import 'package:violet/component/hitomi/hitomi_parser.dart';
import 'package:violet/component/hitomi/population.dart';
import 'package:violet/database/query.dart';
import 'package:violet/database/user/bookmark.dart';
import 'package:violet/locale/locale.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/pages/bookmark/record_view_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:violet/database/query.dart';
import 'package:violet/database/user/record.dart';
import 'package:violet/model/article_list_item.dart';
import 'package:violet/pages/segment/card_panel.dart';
import 'package:violet/settings/settings.dart';
import 'package:violet/widgets/article_item/article_list_item_widget.dart';

class RecordViewPage extends StatelessWidget {
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/database_download/database_download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ class DataBaseDownloadPagepState extends State<DataBaseDownloadPage> {

Future deleteUnused() async {
var sql = HitomiManager.translate2query(
'${Settings.includeTags} ${Settings.excludeTags.where((e) => e.trim() != '').map((e) => '-$e').join(' ')}')
.replaceAll('ExistOnHitomi=1', '');
'${Settings.includeTags} ${Settings.excludeTags.where((e) => e.trim().isNotEmpty).map((e) => '-$e').join(' ')}')
.replaceAll(' AND ExistOnHitomi=1', '');

await (await DataBaseManager.getInstance()).delete('HitomiColumnModel',
'NOT (${sql.substring(sql.indexOf('WHERE') + 6)})', []);
Expand Down
13 changes: 9 additions & 4 deletions lib/pages/main/card/contact_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ class _ContactCardState extends State<ContactCard> {
setState(() => pressed = isTapped);
})
..onTapUp((detail) async {
const url =
'mailto:violet.dev.master@gmail.com?subject=[App Issue] &body=';
if (await canLaunch(url)) {
await launch(url);
final url = Uri(
scheme: 'mailto',
path: 'violet.dev.master@gmail.com',
queryParameters: {
'subject': '[App Issue] ',
},
);
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
}),
child: Container(
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/main/card/discord_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class _DiscordCardState extends State<DiscordCard> {
setState(() => pressed = isTapped);
})
..onTapUp((detail) async {
const url = 'https://discord.gg/K8qny6E';
if (await canLaunch(url)) {
await launch(url);
final url = Uri.parse('https://discord.gg/K8qny6E');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
}),
child: Container(
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/main/card/github_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class _GithubCardState extends State<GithubCard> {
setState(() => pressed = isTapped);
})
..onTapUp((detail) async {
const url = 'https://github.com/project-violet/';
if (await canLaunch(url)) {
await launch(url);
final url = Uri.parse('https://github.com/project-violet/');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
}),
child: Container(
Expand Down
33 changes: 19 additions & 14 deletions lib/pages/main/info/info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class _InfoPageState extends State<InfoPage> {
'향후 동향과 역사를 살펴보세요!',
null,
() async {
const url =
'https://www.notion.so/Violet-WalkRoad-1bd9b8bf4bbf48dd81525f2acd19da45';
if (await canLaunch(url)) {
await launch(url);
final url =
Uri.parse('https://www.notion.so/Violet-WalkRoad-1bd9b8bf4bbf48dd81525f2acd19da45');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
),
Expand All @@ -98,10 +98,15 @@ class _InfoPageState extends State<InfoPage> {
'개발자에게 연락해보세요!',
null,
() async {
const url =
'mailto:violet.dev.master@gmail.com?subject=[App Issue] &body=';
if (await canLaunch(url)) {
await launch(url);
final url = Uri(
scheme: 'mailto',
path: 'violet.dev.master@gmail.com',
queryParameters: {
'subject': '[App Issue] ',
},
);
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
),
Expand All @@ -114,9 +119,9 @@ class _InfoPageState extends State<InfoPage> {
'개발자와 소통해보세요!',
null,
() async {
const url = 'https://discord.gg/K8qny6E';
if (await canLaunch(url)) {
await launch(url);
final url = Uri.parse('https://discord.gg/K8qny6E');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
),
Expand All @@ -128,9 +133,9 @@ class _InfoPageState extends State<InfoPage> {
'프로젝트에 기여해보세요!',
null,
() async {
const url = 'https://github.com/project-violet/violet';
if (await canLaunch(url)) {
await launch(url);
final url = Uri.parse('https://github.com/project-violet/violet');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
),
Expand Down
1 change: 0 additions & 1 deletion lib/pages/main/info/lab/bookmark/bookmarks_records.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:violet/database/query.dart';
import 'package:violet/database/user/record.dart';
import 'package:violet/model/article_list_item.dart';
import 'package:violet/pages/segment/card_panel.dart';
import 'package:violet/settings/settings.dart';
import 'package:violet/widgets/article_item/article_list_item_widget.dart';

class LabRecordViewPage extends StatelessWidget {
Expand Down
1 change: 0 additions & 1 deletion lib/pages/main/info/lab/search_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:violet/component/downloadable.dart';
import 'package:violet/component/hentai.dart';
import 'package:violet/component/hitomi/tag_translate.dart';
import 'package:violet/component/image_provider.dart';
Expand Down
11 changes: 9 additions & 2 deletions lib/pages/main/info/user_manual_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ class _UserManualPageState extends State<UserManualPage> {
physics: const BouncingScrollPhysics(),
selectable: true,
onTapLink: (text, href, title) async {
if (await canLaunch(href!)) {
await launch(href);
if (href == null) {
return;
}
final url = Uri.tryParse(href);
if (url == null) {
return;
}
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
data: (snapshot.data as String).replaceAll('![](',
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/main/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'dart:ui';

import 'package:badges/badges.dart' as badges;
import 'package:carousel_slider/carousel_slider.dart';
import 'package:connectivity/connectivity.dart';
import 'package:ext_storage/ext_storage.dart';
import 'package:flutter/material.dart';
import 'package:flutter_downloader/flutter_downloader.dart'; // @dependent: android
Expand Down Expand Up @@ -67,6 +66,7 @@ class _MainPageState extends ThemeSwitchableState<MainPage>
@override
VoidCallback? get shouldReloadCallback => null;

/*
@override
void initState() {
super.initState();
Expand All @@ -93,6 +93,7 @@ class _MainPageState extends ThemeSwitchableState<MainPage>
// }
// });
}
*/

@override
Widget build(BuildContext context) {
Expand Down
1 change: 0 additions & 1 deletion lib/pages/search/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:auto_animated/auto_animated.dart';
import 'package:flare_flutter/flare_actor.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
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';
Expand Down
1 change: 0 additions & 1 deletion lib/pages/segment/card_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:violet/settings/settings.dart';
import 'package:violet/style/palette.dart';

class CardPanel {
Expand Down

0 comments on commit 6145e1e

Please sign in to comment.