From 87a5409eac4c187d7c178c75b18db0ae13d2048f Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 19 Mar 2020 20:15:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/SearchBook.kt | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/model/SearchBook.kt b/app/src/main/java/io/legado/app/model/SearchBook.kt index 7b344e60f..f70d931a2 100644 --- a/app/src/main/java/io/legado/app/model/SearchBook.kt +++ b/app/src/main/java/io/legado/app/model/SearchBook.kt @@ -1,5 +1,25 @@ 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() + + + private data class SearchEngine(val bookSource: BookSource, var hasMore: Boolean = true) + + interface CallBack { + fun onSearchSuccess() + fun onSearchFinish() + } } \ No newline at end of file