From 245f4b80b3eacecb3c280894d845d3153b54375b Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 22 May 2022 19:22:24 +0800 Subject: [PATCH] add some tips --- app/src/main/assets/updatelog.fy | 11 +++---- .../myreader/ui/activity/ReadActivity.java | 9 ++++-- .../ui/activity/SearchBookActivity.java | 29 +++++++++++++++---- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index 2b1fad5..28404c8 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,10 +1,11 @@ 风月读书v2.4.5 更新内容: -1、修复书籍无法导出缓存的问题 -2、修复部分书源bug -3、修复同名书籍详情页加载bug -4、修复搜索时当前分组不存在时无法搜索的问题 -5、Cookie支持备份&恢复 +1、新增部分提示 +2、修复书籍无法导出缓存的问题 +3、修复部分书源bug +4、修复同名书籍详情页加载bug +5、修复搜索时当前分组不存在时无法搜索的问题 +6、Cookie支持备份&恢复 2022.04.24 风月读书v2.4.4 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index 7bb29d3..26a6f60 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -140,6 +140,7 @@ import xyz.fycz.myreader.widget.page.TxtChar; import static android.view.View.GONE; import static android.view.View.VISIBLE; import static xyz.fycz.myreader.util.UriFileUtil.getPath; +import static xyz.fycz.myreader.widget.page.PageMode.SCROLL; /** * @author fengyue @@ -392,7 +393,7 @@ public class ReadActivity extends BaseActivity implements C @Override public void onLongPress() { - if (mSetting.getPageMode() == PageMode.SCROLL){ + if (mSetting.getPageMode() == SCROLL){ ToastUtils.showWarring("滚动模式暂不支持长按复制"); return; } @@ -515,7 +516,7 @@ public class ReadActivity extends BaseActivity implements C }); binding.readTvListenBook.setOnClickListener(v -> { - if (mSetting.getPageMode() == PageMode.SCROLL) { + if (mSetting.getPageMode() == SCROLL) { ToastUtils.showWarring("朗读暂不支持滚动翻页模式!"); return; } @@ -1274,6 +1275,10 @@ public class ReadActivity extends BaseActivity implements C @Override public void onPageModeChange() { mPageLoader.setPageMode(mSetting.getPageMode()); + if (mSetting.getPageMode().equals(SCROLL)){ + DialogCreator.createTipDialog(ReadActivity.this, + "滚动模式存在大量问题,不建议使用;且作者本人不使用此模式,大概率不会进行修复/优化,也不接受此模式的问题反馈"); + } } @Override diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java index d3eb4e1..18cb0de 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java @@ -105,8 +105,6 @@ public class SearchBookActivity extends BaseActivity private SearchHistoryService mSearchHistoryService; - private int allThreadCount; - private SearchEngine searchEngine; private Setting mSetting; @@ -751,8 +749,7 @@ public class SearchBookActivity extends BaseActivity initSearchList(); List readCrawlers = ReadCrawlerUtil .getEnableReadCrawlers(SharedPreUtils.getInstance().getString("searchGroup")); - allThreadCount = readCrawlers.size(); - if (allThreadCount == 0) { + if (readCrawlers.size() == 0) { ToastUtils.showWarring("当前书源已全部禁用,无法搜索!"); binding.rpb.setIsAutoLoading(false); return; @@ -760,8 +757,28 @@ public class SearchBookActivity extends BaseActivity /*for (ReadCrawler readCrawler : readCrawlers) { searchBookByCrawler(readCrawler, readCrawler.getSearchCharset()); }*/ - searchEngine.initSearchEngine(readCrawlers); - searchEngine.search(searchKey); + if (readCrawlers.size() > 2000 && !SharedPreUtils.getInstance().getBoolean("searchBookWarning")) { + DialogCreator.createThreeButtonDialog(this, "书源过多警告", + "当前搜索书源数量超过2000(建议1000以内),继续搜索可能会导致软件异常(如搜索时前往阅读页返回后将会导致卡死黑屏),确定要继续搜索吗?", + true, "继续搜索并不再提示", "书源管理", "继续搜索", + (dialog, which) -> { + SharedPreUtils.getInstance().putBoolean("searchBookWarning", true); + searchEngine.initSearchEngine(readCrawlers); + searchEngine.search(searchKey); + }, (dialog, which) -> { + startActivityForResult(new Intent(this, BookSourceActivity.class), + APPCONST.REQUEST_BOOK_SOURCE); + }, + (dialog, which) -> { + searchEngine.initSearchEngine(readCrawlers); + searchEngine.search(searchKey); + } + ); + } else { + searchEngine.initSearchEngine(readCrawlers); + searchEngine.search(searchKey); + } + } /**