pull/32/head
kunfei 5 years ago
parent 057ece8aec
commit 2a93dc2ba3
  1. 5
      app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/bookinfo/ChapterListAdapter.kt

@ -3,7 +3,9 @@ package io.legado.app.ui.bookinfo
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.widget.LinearLayout
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
@ -132,9 +134,10 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
} }
private fun initRecyclerView() { private fun initRecyclerView() {
ATH.applyEdgeEffectColor(rv_chapter_list)
adapter = ChapterListAdapter(this) adapter = ChapterListAdapter(this)
ATH.applyEdgeEffectColor(rv_chapter_list)
rv_chapter_list.layoutManager = LinearLayoutManager(this) rv_chapter_list.layoutManager = LinearLayoutManager(this)
rv_chapter_list.addItemDecoration(DividerItemDecoration(this, LinearLayout.VERTICAL))
rv_chapter_list.adapter = adapter rv_chapter_list.adapter = adapter
} }

@ -11,7 +11,7 @@ class ChapterListAdapter(context: Context) : SimpleRecyclerAdapter<BookChapter>(
override fun convert(holder: ItemViewHolder, item: BookChapter, payloads: MutableList<Any>) { override fun convert(holder: ItemViewHolder, item: BookChapter, payloads: MutableList<Any>) {
holder.itemView.apply { holder.itemView.apply {
tv_chapter_name tv_chapter_name.text = item.title
} }
} }

Loading…
Cancel
Save