pull/32/head
kunfei 5 years ago
parent f05cf0274d
commit 728ba09679
  1. 3
      app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt

@ -16,6 +16,7 @@ import io.legado.app.utils.getViewModel
import io.legado.app.utils.hideSoftInput import io.legado.app.utils.hideSoftInput
import kotlinx.android.synthetic.main.activity_source_debug.* import kotlinx.android.synthetic.main.activity_source_debug.*
import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.android.synthetic.main.view_title_bar.*
import kotlinx.coroutines.launch
import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.startActivityForResult
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
@ -32,12 +33,14 @@ class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_s
initRecyclerView() initRecyclerView()
initSearchView() initSearchView()
viewModel.observe{state, msg-> viewModel.observe{state, msg->
launch {
adapter.addItem(msg) adapter.addItem(msg)
if (state == -1 || state == 1000) { if (state == -1 || state == 1000) {
rotate_loading.hide() rotate_loading.hide()
} }
} }
} }
}
private fun initRecyclerView() { private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view) ATH.applyEdgeEffectColor(recycler_view)

Loading…
Cancel
Save