diff --git a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt index 3d6dfb1dc..bba1721af 100644 --- a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt +++ b/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.view.View 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.lib.theme.ATH @@ -15,9 +16,11 @@ class SearchActivity : VMBaseActivity(R.layout.activity_search) override val viewModel: SearchViewModel get() = getViewModel(SearchViewModel::class.java) + private lateinit var adapter: SearchAdapter + override fun onActivityCreated(savedInstanceState: Bundle?) { - initSearchView() initRecyclerView() + initSearchView() } private fun initSearchView() { @@ -50,6 +53,9 @@ class SearchActivity : VMBaseActivity(R.layout.activity_search) private fun initRecyclerView() { ATH.applyEdgeEffectColor(rv_search_list) + adapter = SearchAdapter(this) + rv_search_list.layoutManager = LinearLayoutManager(this) + rv_search_list.adapter = adapter } }