pull/1198/head
gedoor 3 years ago
parent e4cf02fca7
commit 3d34edf4e6
  1. 8
      app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt
  2. 8
      app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt

@ -54,17 +54,14 @@ class BooksAdapterGrid(context: Context, callBack: CallBack) :
private fun onBindGroup(binding: ItemBookshelfGridGroupBinding, position: Int, bundle: Bundle) {
binding.run {
val item = callBack.getItem(position)
if (item is BookGroup) {
val item = callBack.getItem(position) as BookGroup
tvName.text = item.groupName
}
}
}
private fun onBindBook(binding: ItemBookshelfGridBinding, position: Int, bundle: Bundle) {
binding.run {
val item = callBack.getItem(position)
if (item is Book) {
val item = callBack.getItem(position) as Book
bundle.keySet().forEach {
when (it) {
"name" -> tvName.text = item.name
@ -78,7 +75,6 @@ class BooksAdapterGrid(context: Context, callBack: CallBack) :
}
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {

@ -53,17 +53,14 @@ class BooksAdapterList(context: Context, callBack: CallBack) :
private fun onBindGroup(binding: ItemBookshelfListGroupBinding, position: Int, bundle: Bundle) {
binding.run {
val item = callBack.getItem(position)
if (item is BookGroup) {
val item = callBack.getItem(position) as BookGroup
tvName.text = item.groupName
}
}
}
private fun onBindBook(binding: ItemBookshelfListBinding, position: Int, bundle: Bundle) {
binding.run {
val item = callBack.getItem(position)
if (item is Book) {
val item = callBack.getItem(position) as Book
tvRead.text = item.durChapterTitle
tvLast.text = item.latestChapterTitle
bundle.keySet().forEach {
@ -80,7 +77,6 @@ class BooksAdapterList(context: Context, callBack: CallBack) :
}
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {

Loading…
Cancel
Save