From e62da66aed95c75b164d5317d0c83562936660a3 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Mon, 6 Dec 2021 21:13:29 +0800 Subject: [PATCH] fix bug --- .../main/java/xyz/fycz/myreader/model/SearchWordEngine.kt | 4 ++-- .../xyz/fycz/myreader/ui/activity/SearchWordActivity.kt | 6 +++--- .../main/java/xyz/fycz/myreader/util/help/JsExtensions.java | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/xyz/fycz/myreader/model/SearchWordEngine.kt b/app/src/main/java/xyz/fycz/myreader/model/SearchWordEngine.kt index a647a3d..2557795 100644 --- a/app/src/main/java/xyz/fycz/myreader/model/SearchWordEngine.kt +++ b/app/src/main/java/xyz/fycz/myreader/model/SearchWordEngine.kt @@ -37,8 +37,8 @@ class SearchWordEngine( private var scheduler: Scheduler private var compositeDisposable: CompositeDisposable private lateinit var searchListener: OnSearchListener - private val threadsNum = 4 -// SharedPreUtils.getInstance().getInt(App.getmContext().getString(R.string.threadNum), 8) + private val threadsNum = + SharedPreUtils.getInstance().getInt(App.getmContext().getString(R.string.threadNum), 8) private var searchSiteIndex = 0 private var searchSuccessNum = 0 private var searchFinishNum = 0 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt index 9ba5c3b..238a1db 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt @@ -107,14 +107,14 @@ class SearchWordActivity : BaseActivity() { if (index == 0 && item.chapterNum < searchWord1.chapterNum) { adapter.addItem(0, item) break + } else if (index == adapter.itemSize - 1) { + adapter.addItem(item) + break } else if (item.chapterNum >= searchWord1.chapterNum && item.chapterNum < adapter.items[index + 1].chapterNum ) { adapter.addItem(index + 1, item) break - } else if (index == adapter.itemSize - 1) { - adapter.addItem(item) - break } } } diff --git a/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java b/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java index 0e20b09..7b8a674 100644 --- a/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java +++ b/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java @@ -35,8 +35,6 @@ import xyz.fycz.myreader.util.utils.StringUtils; @Keep @SuppressWarnings({"unused"}) - - public interface JsExtensions { String TAG = JsExtensions.class.getSimpleName();