pull/32/head
GKF 6 years ago
parent 9e1e49ba66
commit e9b67f4ff0
  1. 8
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  2. 8
      app/src/main/res/layout/fragment_bookshelf.xml

@ -35,6 +35,7 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
setSupportToolbar(toolbar)
initSearchView()
initRecyclerView()
initBookGroupData()
initBookshelfData()
@ -44,6 +45,13 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) {
menuInflater.inflate(R.menu.bookshelf, menu)
}
private fun initSearchView() {
search_view.visibility = View.VISIBLE
search_view.onActionViewExpanded()
search_view.queryHint = getString(R.string.search_book_key)
search_view.clearFocus()
}
private fun initRecyclerView() {
tv_recent_reading.textColor = ThemeStore.accentColor(tv_recent_reading.context)
rv_book_group.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)

@ -24,8 +24,16 @@
android:padding="5dp"
android:text="@string/recent_reading"/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_bookshelf"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
Loading…
Cancel
Save