pull/32/head
kunfei 5 years ago
parent c41ab2d8b9
commit a707fefc79
  1. 8
      app/src/main/java/io/legado/app/ui/search/SearchActivity.kt

@ -3,6 +3,7 @@ package io.legado.app.ui.search
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.appcompat.widget.SearchView import androidx.appcompat.widget.SearchView
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
@ -15,9 +16,11 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_search)
override val viewModel: SearchViewModel override val viewModel: SearchViewModel
get() = getViewModel(SearchViewModel::class.java) get() = getViewModel(SearchViewModel::class.java)
private lateinit var adapter: SearchAdapter
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
initSearchView()
initRecyclerView() initRecyclerView()
initSearchView()
} }
private fun initSearchView() { private fun initSearchView() {
@ -50,6 +53,9 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_search)
private fun initRecyclerView() { private fun initRecyclerView() {
ATH.applyEdgeEffectColor(rv_search_list) ATH.applyEdgeEffectColor(rv_search_list)
adapter = SearchAdapter(this)
rv_search_list.layoutManager = LinearLayoutManager(this)
rv_search_list.adapter = adapter
} }
} }

Loading…
Cancel
Save