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