pull/32/head
kunfei 5 years ago
parent 5d81eb3233
commit 5b91e44e06
  1. 2
      app/src/main/java/io/legado/app/ui/booksource/BookSourceActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt

@ -38,7 +38,7 @@ class BookSourceActivity : VMBaseActivity<BookshelfViewModel>(R.layout.activity_
private lateinit var adapter: BookSourceAdapter private lateinit var adapter: BookSourceAdapter
private var bookSourceLiveDate: LiveData<PagedList<BookSource>>? = null private var bookSourceLiveDate: LiveData<PagedList<BookSource>>? = null
val qrRequestCode = 101 private val qrRequestCode = 101
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
setSupportActionBar(toolbar) setSupportActionBar(toolbar)

@ -15,6 +15,7 @@ import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.qrcode.QrCodeActivity import io.legado.app.ui.qrcode.QrCodeActivity
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import io.legado.app.utils.hideSoftInput
import io.legado.app.utils.observeEvent import io.legado.app.utils.observeEvent
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.*
@ -27,7 +28,7 @@ class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_s
get() = getViewModel(SourceDebugModel::class.java) get() = getViewModel(SourceDebugModel::class.java)
private lateinit var adapter: SourceDebugAdapter private lateinit var adapter: SourceDebugAdapter
val qrRequestCode = 101 private val qrRequestCode = 101
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
viewModel.init(intent.getStringExtra("key")) viewModel.init(intent.getStringExtra("key"))
@ -51,6 +52,7 @@ class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_s
search_view.clearFocus() search_view.clearFocus()
search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener { search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean { override fun onQueryTextSubmit(query: String?): Boolean {
search_view.hideSoftInput()
startSearch(query ?: "我的") startSearch(query ?: "我的")
return true return true
} }

Loading…
Cancel
Save