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. 50
      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)

@ -1,31 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:attachToActivity="false"
app:title="@string/bookshelf" />
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:attachToActivity="false"
app:title="@string/bookshelf"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_book_group"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:id="@+id/rv_book_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv_recent_reading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/recent_reading" />
android:id="@+id/tv_recent_reading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/recent_reading"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_bookshelf"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<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