diff --git a/app/src/main/java/io/legado/app/model/webbook/SourceDebug.kt b/app/src/main/java/io/legado/app/model/webbook/SourceDebug.kt index aef04abb1..2155cf3c5 100644 --- a/app/src/main/java/io/legado/app/model/webbook/SourceDebug.kt +++ b/app/src/main/java/io/legado/app/model/webbook/SourceDebug.kt @@ -88,4 +88,15 @@ class SourceDebug(private val webBook: WebBook, callback: Callback) { printLog(debugSource, -1, it.localizedMessage) } } + + fun printLog( + sourceUrl: String?, + state: Int, + msg: String, + print: Boolean = true, + isHtml: Boolean = false + ): SourceDebug { + SourceDebug.printLog(sourceUrl, state, msg, print, isHtml) + return this + } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt index be5966534..641aec977 100644 --- a/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt @@ -78,12 +78,12 @@ class SourceDebugActivity : BaseActivity(), SourceDebug.Callba val book = Book() book.origin = it.bookSourceUrl book.bookUrl = key - SourceDebug.printLog(it.bookSourceUrl, 1, "开始访问$key") SourceDebug(WebBook(it), this) + .printLog(it.bookSourceUrl, 1, "开始访问$key") .infoDebug(book) } else { - SourceDebug.printLog(it.bookSourceUrl, 1, "开始搜索关键字$key") SourceDebug(WebBook(it), this) + .printLog(it.bookSourceUrl, 1, "开始搜索关键字$key") .searchDebug(key) } } ?: toast("未获取到书源") @@ -93,7 +93,7 @@ class SourceDebugActivity : BaseActivity(), SourceDebug.Callba launch { synchronized(this) { adapter.logList.add(msg) - adapter.notifyItemChanged(adapter.logList.size - 1) + adapter.notifyItemInserted(adapter.logList.size - 1) if (state == -1 || state == 1000) { rotate_loading.hide() }