diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index a41fcd656..195a1c5e5 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -11,6 +11,7 @@ import androidx.lifecycle.Observer import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.google.android.flexbox.FlexboxLayoutManager import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseActivity @@ -133,11 +134,10 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se ATH.applyEdgeEffectColor(rv_bookshelf_search) ATH.applyEdgeEffectColor(rv_history_key) bookAdapter = BookAdapter(this, this) - rv_bookshelf_search.layoutManager = - LinearLayoutManager(this, RecyclerView.HORIZONTAL, false) + rv_bookshelf_search.layoutManager = FlexboxLayoutManager(this) rv_bookshelf_search.adapter = bookAdapter historyKeyAdapter = HistoryKeyAdapter(this, this) - rv_history_key.layoutManager = LinearLayoutManager(this, RecyclerView.HORIZONTAL, false) + rv_history_key.layoutManager = FlexboxLayoutManager(this) rv_history_key.adapter = historyKeyAdapter adapter = SearchAdapter(this, this) recycler_view.layoutManager = LinearLayoutManager(this)