|
|
|
@ -5,6 +5,7 @@ import android.os.Bundle |
|
|
|
|
import android.view.View |
|
|
|
|
import android.view.ViewGroup |
|
|
|
|
import androidx.appcompat.widget.PopupMenu |
|
|
|
|
import androidx.core.view.isGone |
|
|
|
|
import androidx.recyclerview.widget.DiffUtil |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.adapter.DiffRecyclerAdapter |
|
|
|
@ -16,7 +17,11 @@ import io.legado.app.utils.visible |
|
|
|
|
import splitties.views.onLongClick |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ChangeSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
|
class ChangeSourceAdapter( |
|
|
|
|
context: Context, |
|
|
|
|
val viewModel: ChangeSourceViewModel, |
|
|
|
|
val callBack: CallBack |
|
|
|
|
) : |
|
|
|
|
DiffRecyclerAdapter<SearchBook, ItemChangeSourceBinding>(context) { |
|
|
|
|
|
|
|
|
|
override val diffItemCallback: DiffUtil.ItemCallback<SearchBook> |
|
|
|
@ -46,6 +51,8 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
|
binding.apply { |
|
|
|
|
if (bundle == null) { |
|
|
|
|
tvOrigin.text = item.originName |
|
|
|
|
tvAuthor.text = context.getString(R.string.author_show, item.author) |
|
|
|
|
tvAuthor.isGone = viewModel.author == item.author |
|
|
|
|
tvLast.text = item.getDisplayLastChapterTitle() |
|
|
|
|
if (callBack.bookUrl == item.bookUrl) { |
|
|
|
|
ivChecked.visible() |
|
|
|
|