pull/37/head
kunfei 5 years ago
parent 799a838015
commit 43dce8abe4
  1. 6
      app/src/main/java/io/legado/app/ui/main/bookshelf/BooksAdapter.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt

@ -10,9 +10,8 @@ import io.legado.app.R
import io.legado.app.constant.BookType
import io.legado.app.data.entities.Book
import io.legado.app.help.ImageLoader
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.lib.theme.ATH
import io.legado.app.utils.LogUtils
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.invisible
import kotlinx.android.synthetic.main.item_bookshelf_list.view.*
import org.jetbrains.anko.sdk27.listeners.onClick
@ -63,11 +62,10 @@ class BooksAdapter(private val callBack: CallBack) :
class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
init {
itemView.setBackgroundColor(ThemeStore.backgroundColor(itemView.context))
ATH.applyBackgroundTint(itemView)
}
fun bind(book: Book, callBack: CallBack) = with(itemView) {
this.setBackgroundColor(context.getCompatColor(R.color.background))
tv_name.text = book.name
tv_author.text = book.author
tv_read.text = book.durChapterTitle

@ -9,6 +9,7 @@ import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.data.entities.BookSource
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.utils.ACache
import io.legado.app.utils.gone
@ -28,6 +29,7 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList<Any>) {
with(holder.itemView) {
if (payloads.isEmpty()) {
ATH.applyBackgroundTint(ll_title)
tv_name.text = item.bookSourceName
ll_title.onClick {
val oldEx = exIndex

Loading…
Cancel
Save