feat: 优化代码

pull/169/head
kunfei 5 years ago
parent 5933e33a4c
commit 87a5409eac
  1. 22
      app/src/main/java/io/legado/app/model/SearchBook.kt

@ -1,5 +1,25 @@
package io.legado.app.model package io.legado.app.model
class SearchBook { import io.legado.app.data.entities.BookSource
import io.legado.app.help.AppConfig
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.asCoroutineDispatcher
import java.util.concurrent.Executors
class SearchBook(scope: CoroutineScope, callBack: CallBack) {
private var searchPool =
Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher()
private var searchId = System.currentTimeMillis()
private var searchPage = 1
private var searchKey: String = ""
private val searchEngines = arrayListOf<SearchEngine>()
private data class SearchEngine(val bookSource: BookSource, var hasMore: Boolean = true)
interface CallBack {
fun onSearchSuccess()
fun onSearchFinish()
}
} }
Loading…
Cancel
Save