pull/2425/head
kunfei 2 years ago
parent 58c096d8dc
commit 5ee45055ea
  1. 8
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt
  3. 4
      app/src/main/res/menu/book_source_item.xml

@ -29,6 +29,8 @@ import io.legado.app.model.CheckSource
import io.legado.app.model.Debug import io.legado.app.model.Debug
import io.legado.app.ui.association.ImportBookSourceDialog import io.legado.app.ui.association.ImportBookSourceDialog
import io.legado.app.ui.book.import.local.rule.TxtTocRuleActivity 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.debug.BookSourceDebugActivity
import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity
import io.legado.app.ui.config.CheckSourceConfig import io.legado.app.ui.config.CheckSourceConfig
@ -605,6 +607,12 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
viewModel.bottomSource(bookSource) viewModel.bottomSource(bookSource)
} }
override fun searchBook(bookSource: BookSource) {
startActivity<SearchActivity> {
putExtra("searchScope", SearchScope(bookSource).toString())
}
}
override fun debug(bookSource: BookSource) { override fun debug(bookSource: BookSource) {
startActivity<BookSourceDebugActivity> { startActivity<BookSourceDebugActivity> {
putExtra("key", bookSource.bookSourceUrl) putExtra("key", bookSource.bookSourceUrl)

@ -188,6 +188,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
putExtra("type", "bookSource") putExtra("type", "bookSource")
putExtra("key", source.bookSourceUrl) putExtra("key", source.bookSourceUrl)
} }
R.id.menu_search -> callBack.searchBook(source)
R.id.menu_debug_source -> callBack.debug(source) R.id.menu_debug_source -> callBack.debug(source)
R.id.menu_del -> callBack.del(source) R.id.menu_del -> callBack.del(source)
R.id.menu_enable_explore -> { R.id.menu_enable_explore -> {
@ -314,6 +315,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
fun update(vararg bookSource: BookSource) fun update(vararg bookSource: BookSource)
fun toTop(bookSource: BookSource) fun toTop(bookSource: BookSource)
fun toBottom(bookSource: BookSource) fun toBottom(bookSource: BookSource)
fun searchBook(bookSource: BookSource)
fun debug(bookSource: BookSource) fun debug(bookSource: BookSource)
fun upOrder() fun upOrder()
fun upCountView() fun upCountView()

@ -13,6 +13,10 @@
android:id="@+id/menu_login" android:id="@+id/menu_login"
android:title="@string/login" /> android:title="@string/login" />
<item
android:id="@+id/menu_search"
android:title="@string/search" />
<item <item
android:id="@+id/menu_debug_source" android:id="@+id/menu_debug_source"
android:title="@string/debug" /> android:title="@string/debug" />

Loading…
Cancel
Save