Skip to content

Commit

Permalink
Bug fixes & new features for v0.3.1 (#93)
Browse files Browse the repository at this point in the history
* Added refresh button & fixed images cropping in single page screen

* addded resume button to manga details screen

* added last page read support

* version bump to v0.3.1
  • Loading branch information
DattatreyaReddy authored Dec 14, 2022
1 parent f38354e commit 412bc43
Show file tree
Hide file tree
Showing 28 changed files with 392 additions and 287 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img width=200px height=200px src="assets/icons/launcher/sorayomi_icon.png" alt="Tachidesk Sorayomi logo"></a>
<img width=200px height=200px src="assets/icons/launcher/sorayomi_icon.png" alt="Tachidesk Sorayomi logo"/>
</p>

<h1 align="center"> Tachidesk Sorayomi </h1>
Expand Down
119 changes: 61 additions & 58 deletions assets/locales/en_US.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,17 @@
{
"AuthType": {
"basic": "Basic Auth",
"none": "None"
},
"ChapterSort": {
"fetchedDate": "By Fetched Data",
"source": "By Source"
},
"DisplayMode": {
"descriptiveList": "Descriptive List",
"grid": "Grid",
"list": "List"
},
"MangaSort": {
"alphabetical": "Alphabetical",
"dateAdded": "Date Added",
"unread": "Unread"
},
"MangaStatus": {
"cancelled": "Cancelled",
"completed": "Completed",
"licensed": "Licensed",
"onHiatus": "On Hiatus",
"ongoing": "Ongoing",
"publishingFinished": "Publishing Finished",
"unknown": "Unknown"
},
"ReaderMode": {
"continuousHorizontalLTR": "Continuous Horizontal (LTR)",
"continuousHorizontalRTL": "Continuous Horizontal (RTL)",
"continuousVertical": "Continuous Vertical",
"defaultReader": "Default",
"singleHorizontalLTR": "Single Horizontal (LTR)",
"singleHorizontalRTL": "Single Horizontal (RTL)",
"singleVertical": "Single Vertical",
"webtoon": "Webtoon"
},
"ReaderNavigationLayout": {
"disabled": "Disabled",
"edge": "Edge",
"kindlish": "Kindle-ish",
"lShaped": "L Shaped",
"rightAndLeft": "Right and Left",
"defaultNavigation": "Default"
},
"SourceType": {
"filter": "Filter",
"latest": "Latest",
"popular": "Popular"
},
"ThemeMode": {
"dark": "Dark",
"light": "Light",
"system": "System"
},
"about": "About",
"add": "Add",
"addCategory": "Add Category",
"addCategoryHint": "Add new categories in settings",
"addToLibrary": "Add to Library",
"appearance": "Appearance",
"appTheme": "App Theme",
"appTitle": "Tachidesk Sorayomi",
"appearance": "Appearance",
"artist": "Artist",
"AuthType": {
"basic": "Basic Auth",
"none": "None"
},
"backup": "Backup & Restore",
"badges": "Badges",
"baseAuthType": "Authentication Type",
Expand All @@ -87,6 +36,10 @@
},
"chapterNumber": "Chapter {number}",
"chapters": "Chapters",
"ChapterSort": {
"fetchedDate": "By Fetched Data",
"source": "By Source"
},
"checkForServerUpdates": "Check for Server updates",
"checkForUpdates": "Check for updates",
"client": "Client",
Expand All @@ -110,6 +63,11 @@
"discord": "Discord",
"display": "Display",
"displayMode": "Display Mode",
"DisplayMode": {
"descriptiveList": "Descriptive List",
"grid": "Grid",
"list": "List"
},
"downloaded": "Downloaded",
"downloads": "Downloads",
"edit": "Edit",
Expand Down Expand Up @@ -152,6 +110,20 @@
"loading": "Loading!",
"manga": "Manga",
"mangaSearch": "Search manga..",
"MangaSort": {
"alphabetical": "Alphabetical",
"dateAdded": "Date Added",
"unread": "Unread"
},
"MangaStatus": {
"cancelled": "Cancelled",
"completed": "Completed",
"licensed": "Licensed",
"ongoing": "Ongoing",
"onHiatus": "On Hiatus",
"publishingFinished": "Publishing Finished",
"unknown": "Unknown"
},
"missingExtension": "Missing Extensions",
"missingTrackers": "Missing Trackers",
"more": "More",
Expand All @@ -178,16 +150,35 @@
},
"nsfw18": "18+",
"numSelected": "{num} Selected",
"page": "Page: {number}",
"password": "Password",
"pause": "Pause",
"pending": "Pending",
"popular": "Popular",
"previousChapter": "Previous Chapter",
"reader": "Reader",
"readerMode": "Reading Mode",
"ReaderMode": {
"continuousHorizontalLTR": "Continuous Horizontal (LTR)",
"continuousHorizontalRTL": "Continuous Horizontal (RTL)",
"continuousVertical": "Continuous Vertical",
"defaultReader": "Default",
"singleHorizontalLTR": "Single Horizontal (LTR)",
"singleHorizontalRTL": "Single Horizontal (RTL)",
"singleVertical": "Single Vertical",
"webtoon": "Webtoon"
},
"readerNavigationLayout": "Navigation layout",
"readerNavigationLayoutInvert": "Invert tapping",
"ReaderNavigationLayout": {
"defaultNavigation": "Default",
"disabled": "Disabled",
"edge": "Edge",
"kindlish": "Kindle-ish",
"lShaped": "L Shaped",
"rightAndLeft": "Right and Left"
},
"readerNavigationLayout_": "Navigation layout",
"readerNavigationLayoutInvert": "Invert tapping",
"readerSettingsView": "Reader Settings",
"reddit": "Reddit",
"refresh": "Refresh",
Expand All @@ -206,8 +197,8 @@
"savedImagePathTitle": "Image path saved to Clipboard",
"search": "Search...",
"searchGlobally": "Search Globally",
"searchManga": "Search manga..",
"searchingForUpdates": "Searching for updates...",
"searchManga": "Search manga..",
"server": "Server",
"serverVersion": "Server version",
"setAsDefault": "Set as default",
Expand All @@ -225,7 +216,18 @@
"sortUnread": "Unread",
"source": "Source",
"sources": "Sources",
"SourceType": {
"filter": "Filter",
"latest": "Latest",
"popular": "Popular"
},
"start": "Start",
"status": "Status",
"ThemeMode": {
"dark": "Dark",
"light": "Light",
"system": "System"
},
"uninstall": "Uninstall",
"uninstalling": "Uninstalling",
"unknown": "Unknown",
Expand All @@ -234,6 +236,7 @@
"unknownSource": "Unknown Source",
"unread": "Unread",
"update": "Update",
"updateCompleted": "Update Completed",
"updates": "Updates",
"updatesSummary": "Updates Summary",
"updating": "Updating",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ClipboardListTile extends ConsumerWidget {
final String? subtitle;
@override
Widget build(BuildContext context, WidgetRef ref) {
final Toast toast = ref.watch(toastProvider(context));
return ListTile(
title: Text(title),
subtitle: subtitle.isNotBlank ? Text(subtitle!) : null,
Expand All @@ -33,10 +32,9 @@ class ClipboardListTile extends ConsumerWidget {
Clipboard.setData(
ClipboardData(text: msg),
);
toast.close();
toast.show(
LocaleKeys.copyMsg.tr(namedArgs: {"msg": msg}),
);
ref.read(toastProvider(context)).instantShow(
LocaleKeys.copyMsg.tr(namedArgs: {"msg": msg}),
);
}
: null,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ class ExtensionScreen extends HookConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final toast = ref.watch(toastProvider(context));
final extensionMapData = ref.watch(extensionMapFilteredAndQueriedProvider)
..showToastOnError(toast, withMicrotask: true);
..showToastOnError(ref.read(toastProvider(context)), withMicrotask: true);
final extensionMap = {...?extensionMapData.valueOrNull};
final installed = extensionMap.remove("installed");
final update = extensionMap.remove("update");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class ExtensionListTile extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final repository = ref.watch(extensionRepositoryProvider);
final toast = ref.watch(toastProvider(context));
final isLoading = useState(false);
return ListTile(
key: key,
Expand Down Expand Up @@ -85,7 +84,7 @@ class ExtensionListTile extends HookConsumerWidget {

await refresh();
}))
.showToastOnError(toast);
.showToastOnError(ref.read(toastProvider(context)));
isLoading.value = false;
} catch (e) {
//
Expand Down Expand Up @@ -114,7 +113,7 @@ class ExtensionListTile extends HookConsumerWidget {
await repository.installExtension(extension.pkgName!);
await refresh();
}))
.showToastOnError(toast);
.showToastOnError(ref.read(toastProvider(context)));
isLoading.value = false;
} catch (e) {
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class SourceScreen extends HookConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final toast = ref.watch(toastProvider(context));
final sourceMapData = ref.watch(sourceMapFilteredProvider)
..showToastOnError(toast, withMicrotask: true);
..showToastOnError(ref.read(toastProvider(context)), withMicrotask: true);
final sourceMap = {...?sourceMapData.valueOrNull};
final localSource = sourceMap.remove("localsourcelang");
final lastUsed = sourceMap.remove("lastUsed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ class EditCategoryScreen extends ConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final toast = ref.watch(toastProvider(context));
final categoryList = ref.watch(categoryListProvider())
..showToastOnError(toast, withMicrotask: true);
..showToastOnError(ref.read(toastProvider(context)), withMicrotask: true);
return Scaffold(
appBar: AppBar(
title: Text(LocaleKeys.editCategory.tr()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../../constants/app_sizes.dart';
import '../../../../i18n/locale_keys.g.dart';
import '../../../../routes/router_config.dart';
import '../../../../utils/extensions/custom_extensions.dart';
import '../../../../utils/misc/toast/toast.dart';
import '../../../../widgets/emoticons.dart';
import '../../domain/chapter/chapter_model.dart';
import '../../widgets/chapter_actions/multi_chapters_actions_bottom_app_bar.dart';
Expand All @@ -33,8 +36,20 @@ class MangaDetailsScreen extends HookConsumerWidget {
final chapterList = ref.watch(chapterListProvider);
final selectedChapters = useState<Map<int, Chapter>>({});
refresh([useCache = true]) async {
if (context.mounted && !useCache) {
ref.read(toastProvider(context)).show(
LocaleKeys.updating.tr(),
withMicrotask: true,
);
}
await ref.read(chapterListProvider.notifier).refresh(useCache);
await ref.read(provider.notifier).refresh(useCache);
if (context.mounted && !useCache) {
ref.read(toastProvider(context)).show(
LocaleKeys.updateCompleted.tr(),
withMicrotask: true,
);
}
}

useEffect(() {
Expand Down Expand Up @@ -87,6 +102,11 @@ class MangaDetailsScreen extends HookConsumerWidget {
: AppBar(
title: Text(data?.title ?? LocaleKeys.manga.tr()),
actions: [
if (context.isTablet)
IconButton(
onPressed: () => refresh(false),
icon: const Icon(Icons.refresh_rounded),
),
Builder(
builder: (context) => IconButton(
onPressed: () {
Expand All @@ -113,15 +133,20 @@ class MangaDetailsScreen extends HookConsumerWidget {
icon: const Icon(Icons.more_vert_rounded),
itemBuilder: (context) => [
PopupMenuItem(
child: Text(LocaleKeys.editCategory.tr()),
onTap: () => Future.microtask(
() => showDialog(
context: context,
builder: (context) =>
EditMangaCategoryDialog(mangaId: mangaId),
),
),
child: Text(LocaleKeys.editCategory.tr()),
),
if (!context.isTablet)
PopupMenuItem(
onTap: () => refresh(false),
child: Text(LocaleKeys.refresh.tr()),
),
],
)
],
Expand All @@ -137,6 +162,21 @@ class MangaDetailsScreen extends HookConsumerWidget {
selectedChapters: selectedChapters,
)
: null,
floatingActionButton: FloatingActionButton.extended(
isExtended: context.isTablet,
label: Text(
data?.lastChapterRead?.index != null
? LocaleKeys.resume.tr()
: LocaleKeys.start.tr(),
),
icon: const Icon(Icons.play_arrow_rounded),
onPressed: () {
context.push(
Routes.getReader(
"${data?.id}", "${data?.lastChapterRead?.index ?? 1}"),
);
},
),
body: data != null
? context.isTablet
? BigScreenMangaDetails(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class BigScreenMangaDetails extends ConsumerWidget {
),
Expanded(
child: ListView.builder(
physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (filteredChapterList.length == index) {
return const ListTile();
Expand Down
Loading

0 comments on commit 412bc43

Please sign in to comment.