|
|
@ -10,7 +10,6 @@ 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 org.jetbrains.anko.toast |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DownloadAdapter(context: Context, private val callBack: CallBack) : |
|
|
|
class DownloadAdapter(context: Context, private val callBack: CallBack) : |
|
|
@ -53,17 +52,10 @@ class DownloadAdapter(context: Context, private val callBack: CallBack) : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tv_export.onClick { |
|
|
|
tv_export.onClick { |
|
|
|
getItem(holder.layoutPosition)?.let { |
|
|
|
|
|
|
|
val cacheSize = cacheChapters[it.bookUrl]?.size ?: 0 |
|
|
|
|
|
|
|
if (cacheSize < it.totalChapterNum) { |
|
|
|
|
|
|
|
context.toast("未下载完成") |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callBack.export(holder.layoutPosition) |
|
|
|
callBack.export(holder.layoutPosition) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun upDownloadIv(iv: ImageView, book: Book) { |
|
|
|
private fun upDownloadIv(iv: ImageView, book: Book) { |
|
|
|
downloadMap?.let { |
|
|
|
downloadMap?.let { |
|
|
|