pull/32/head
kunfei 5 years ago
parent 0e66b033e8
commit f9ebd4ac8d
  1. 14
      app/src/main/java/io/legado/app/ui/search/SearchActivity.kt

@ -1,9 +1,11 @@
package io.legado.app.ui.search
import android.os.Bundle
import android.view.View
import io.legado.app.R
import io.legado.app.base.BaseActivity
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.view_title_bar.*
class SearchActivity : BaseActivity<SearchViewModel>() {
@ -14,7 +16,19 @@ class SearchActivity : BaseActivity<SearchViewModel>() {
get() = R.layout.activity_search
override fun onViewModelCreated(viewModel: SearchViewModel, savedInstanceState: Bundle?) {
initSearchView()
viewModel.search()
}
private fun initSearchView() {
search_view.visibility = View.VISIBLE
search_view.onActionViewExpanded()
search_view.isSubmitButtonEnabled = true
search_view.queryHint = getString(R.string.search_book_key)
search_view.clearFocus()
intent.getStringExtra("key")?.let {
search_view.setQuery(it, true)
}
}
}

Loading…
Cancel
Save