|
|
@ -8,6 +8,7 @@ import io.legado.app.help.EventMessage |
|
|
|
import io.legado.app.model.WebBook |
|
|
|
import io.legado.app.model.WebBook |
|
|
|
import io.legado.app.model.webbook.SourceDebug |
|
|
|
import io.legado.app.model.webbook.SourceDebug |
|
|
|
import io.legado.app.utils.postEvent |
|
|
|
import io.legado.app.utils.postEvent |
|
|
|
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
|
|
|
|
|
|
|
class SourceDebugModel(application: Application) : BaseViewModel(application), SourceDebug.Callback { |
|
|
|
class SourceDebugModel(application: Application) : BaseViewModel(application), SourceDebug.Callback { |
|
|
|
|
|
|
|
|
|
|
@ -31,8 +32,10 @@ class SourceDebugModel(application: Application) : BaseViewModel(application), S |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun printLog(state: Int, msg: String) { |
|
|
|
override fun printLog(state: Int, msg: String) { |
|
|
|
|
|
|
|
launch { |
|
|
|
postEvent(Bus.SOURCE_DEBUG_LOG, EventMessage.obtain(state, msg)) |
|
|
|
postEvent(Bus.SOURCE_DEBUG_LOG, EventMessage.obtain(state, msg)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onCleared() { |
|
|
|
override fun onCleared() { |
|
|
|
super.onCleared() |
|
|
|
super.onCleared() |
|
|
|