|
|
@ -10,13 +10,15 @@ import io.legado.app.data.entities.BookChapter |
|
|
|
import io.legado.app.service.help.Download |
|
|
|
import io.legado.app.service.help.Download |
|
|
|
import kotlinx.android.synthetic.main.item_download.view.* |
|
|
|
import kotlinx.android.synthetic.main.item_download.view.* |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap |
|
|
|
|
|
|
|
import java.util.concurrent.CopyOnWriteArraySet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DownloadAdapter(context: Context, private val callBack: CallBack) : |
|
|
|
class DownloadAdapter(context: Context, private val callBack: CallBack) : |
|
|
|
SimpleRecyclerAdapter<Book>(context, R.layout.item_download) { |
|
|
|
SimpleRecyclerAdapter<Book>(context, R.layout.item_download) { |
|
|
|
|
|
|
|
|
|
|
|
val cacheChapters = hashMapOf<String, HashSet<String>>() |
|
|
|
val cacheChapters = hashMapOf<String, HashSet<String>>() |
|
|
|
var downloadMap: HashMap<String, LinkedHashSet<BookChapter>>? = null |
|
|
|
var downloadMap: ConcurrentHashMap<String, CopyOnWriteArraySet<BookChapter>>? = null |
|
|
|
|
|
|
|
|
|
|
|
override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList<Any>) { |
|
|
|
override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList<Any>) { |
|
|
|
with(holder.itemView) { |
|
|
|
with(holder.itemView) { |
|
|
|