mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Feat: Image favorites (#126)
* feat: 增加图片收藏 * feat: 主体图片收藏页面实现 * feat: 点击打开大图浏览 * feat: 数据结构变更 * feat: 基本完成 * feat: 翻译与bug修复 * feat: 实机测试和问题修复 * feat: jm导入, pica历史记录nhentai有问题, 一键反转 * fix: 大小写不一致, 一个htManga, 一个htmanga * feat: 拉取收藏优化 * feat: 改成以ep为准 * feat: 兜底一些可能报错场景 * chore: 没有用到 * feat: 尽量保证和网络收藏顺序一致 * feat: 支持显示热点tag * feat: 支持双击收藏, 不过此时禁止放大图片 * fix: 自动塞封面逻辑完善, 切换快速收藏图片立刻生效 * Refactor * fix updateValue * feat: 双击功能提示 * fix: 被确定取消收藏的才删除 * Refactor ImageFavoritesPage * translate author * feat: 功能提示改到dialog中 * fix text editing * fix text editing * feat: 功能提示放到邮件或长按菜单中 * fix: 修复tag过滤不生效问题 * Improve image loading * The default value of quickCollectImage should be false. * Refactor DragListener * Refactor ImageFavoriteItem & ImageFavoritePhotoView * Refactor * Fix `ImageFavoriteManager.has` * Fix UI * Improve UI --------- Co-authored-by: nyne <me@nyne.dev>
This commit is contained in:
@@ -107,15 +107,16 @@ class _AppSettingsState extends State<AppSettings> {
|
||||
actionTitle: 'Export'.tl,
|
||||
).toSliver(),
|
||||
_CallbackSetting(
|
||||
title: "Import App Data".tl,
|
||||
title: "Import App Data (Please restart after success)".tl,
|
||||
callback: () async {
|
||||
var controller = showLoadingDialog(context);
|
||||
var file = await selectFile(ext: ['venera', 'picadata']);
|
||||
if (file != null) {
|
||||
var cacheFile = File(FilePath.join(App.cachePath, "import_data_temp"));
|
||||
var cacheFile =
|
||||
File(FilePath.join(App.cachePath, "import_data_temp"));
|
||||
await file.saveTo(cacheFile.path);
|
||||
try {
|
||||
if(file.name.endsWith('picadata')) {
|
||||
if (file.name.endsWith('picadata')) {
|
||||
await importPicaData(cacheFile);
|
||||
} else {
|
||||
await importAppData(cacheFile);
|
||||
@@ -123,8 +124,7 @@ class _AppSettingsState extends State<AppSettings> {
|
||||
} catch (e, s) {
|
||||
Log.error("Import data", e.toString(), s);
|
||||
context.showMessage(message: "Failed to import data".tl);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
cacheFile.deleteIgnoreError();
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,9 @@ class _LocalFavoritesSettingsState extends State<LocalFavoritesSettings> {
|
||||
SelectSetting(
|
||||
title: "Quick Favorite".tl,
|
||||
settingKey: "quickFavorite",
|
||||
help: "Long press on the favorite button to quickly add to this folder".tl,
|
||||
help:
|
||||
"Long press on the favorite button to quickly add to this folder"
|
||||
.tl,
|
||||
optionTranslation: {
|
||||
for (var e in LocalFavoritesManager().folderNames) e: e
|
||||
},
|
||||
@@ -44,7 +46,8 @@ class _LocalFavoritesSettingsState extends State<LocalFavoritesSettings> {
|
||||
var controller = showLoadingDialog(context);
|
||||
var count = await LocalFavoritesManager().removeInvalid();
|
||||
controller.close();
|
||||
context.showMessage(message: "Deleted @a favorite items".tlParams({'a': count}));
|
||||
context.showMessage(
|
||||
message: "Deleted @a favorite items".tlParams({'a': count}));
|
||||
},
|
||||
actionTitle: 'Delete'.tl,
|
||||
).toSliver(),
|
||||
|
@@ -116,6 +116,21 @@ class _ReaderSettingsState extends State<ReaderSettings> {
|
||||
widget.onChanged?.call("enableClockAndBatteryInfoInReader");
|
||||
},
|
||||
).toSliver(),
|
||||
SelectSetting(
|
||||
title: "Quick collect image".tl,
|
||||
settingKey: "quickCollectImage",
|
||||
optionTranslation: {
|
||||
"No": "Not enable".tl,
|
||||
"DoubleTap": "Double Tap".tl,
|
||||
"Swipe": "Swipe".tl,
|
||||
},
|
||||
onChanged: () {
|
||||
widget.onChanged?.call("quickCollectImage");
|
||||
},
|
||||
help:
|
||||
"On the image browsing page, you can quickly collect images by sliding horizontally or vertically according to your reading mode"
|
||||
.tl,
|
||||
).toSliver(),
|
||||
_PopupWindowSetting(
|
||||
title: "Custom Image Processing".tl,
|
||||
builder: () => _CustomImageProcessing(),
|
||||
|
Reference in New Issue
Block a user