|
|
|
@ -6,9 +6,12 @@ import androidx.appcompat.widget.SearchView |
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
|
import io.legado.app.constant.Bus |
|
|
|
|
import io.legado.app.help.EventMessage |
|
|
|
|
import io.legado.app.lib.theme.ATH |
|
|
|
|
import io.legado.app.lib.theme.ThemeStore |
|
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
|
import io.legado.app.utils.observeEvent |
|
|
|
|
import kotlinx.android.synthetic.main.activity_source_debug.* |
|
|
|
|
import kotlinx.android.synthetic.main.view_title_bar.* |
|
|
|
|
import org.jetbrains.anko.toast |
|
|
|
@ -24,12 +27,6 @@ class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_s |
|
|
|
|
viewModel.init(intent.getStringExtra("key")) |
|
|
|
|
initRecyclerView() |
|
|
|
|
initSearchView() |
|
|
|
|
viewModel.observeLogs(this) { |
|
|
|
|
adapter.addItem(it.obj as String) |
|
|
|
|
if (it.what == -1 || it.what == 1000) { |
|
|
|
|
rotate_loading.hide() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun initRecyclerView() { |
|
|
|
@ -66,4 +63,13 @@ class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_s |
|
|
|
|
toast("未获取到书源") |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun observeLiveBus() { |
|
|
|
|
observeEvent<EventMessage>(Bus.SOURCE_DEBUG_LOG){ |
|
|
|
|
adapter.addItem(it.obj as String) |
|
|
|
|
if (it.what == -1 || it.what == 1000) { |
|
|
|
|
rotate_loading.hide() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |