From 5ee45055eaf0667c0d203541651c5930c06befd9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 14 Oct 2022 09:43:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/source/manage/BookSourceActivity.kt | 8 ++++++++ .../legado/app/ui/book/source/manage/BookSourceAdapter.kt | 2 ++ app/src/main/res/menu/book_source_item.xml | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index f845dc1d2..e0bb068d1 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -29,6 +29,8 @@ import io.legado.app.model.CheckSource import io.legado.app.model.Debug import io.legado.app.ui.association.ImportBookSourceDialog import io.legado.app.ui.book.import.local.rule.TxtTocRuleActivity +import io.legado.app.ui.book.search.SearchActivity +import io.legado.app.ui.book.search.SearchScope import io.legado.app.ui.book.source.debug.BookSourceDebugActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.ui.config.CheckSourceConfig @@ -605,6 +607,12 @@ class BookSourceActivity : VMBaseActivity { + putExtra("searchScope", SearchScope(bookSource).toString()) + } + } + override fun debug(bookSource: BookSource) { startActivity { putExtra("key", bookSource.bookSourceUrl) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt index c6dd8598d..2d10abf4d 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt @@ -188,6 +188,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) : putExtra("type", "bookSource") putExtra("key", source.bookSourceUrl) } + R.id.menu_search -> callBack.searchBook(source) R.id.menu_debug_source -> callBack.debug(source) R.id.menu_del -> callBack.del(source) R.id.menu_enable_explore -> { @@ -314,6 +315,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) : fun update(vararg bookSource: BookSource) fun toTop(bookSource: BookSource) fun toBottom(bookSource: BookSource) + fun searchBook(bookSource: BookSource) fun debug(bookSource: BookSource) fun upOrder() fun upCountView() diff --git a/app/src/main/res/menu/book_source_item.xml b/app/src/main/res/menu/book_source_item.xml index acc6a6ed8..384d30516 100644 --- a/app/src/main/res/menu/book_source_item.xml +++ b/app/src/main/res/menu/book_source_item.xml @@ -13,6 +13,10 @@ android:id="@+id/menu_login" android:title="@string/login" /> + +