From a707fefc798faf01e98c7b4e34887876ebb134ce Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 3 Aug 2019 21:09:33 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/search/SearchActivity.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 } }