mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Use List
This commit is contained in:
parent
fa14b5e17f
commit
aba5ea9a44
3 changed files with 4 additions and 4 deletions
|
@ -39,8 +39,8 @@ data class VisualDownloadChildCached(
|
|||
): VisualDownloadCachedAbstract(currentBytes, totalBytes, data)
|
||||
|
||||
data class VisualDownloadHeaderCached(
|
||||
override val totalBytes: Long,
|
||||
override val currentBytes: Long,
|
||||
override val totalBytes: Long,
|
||||
override val data: VideoDownloadHelper.DownloadHeaderCached,
|
||||
val child: VideoDownloadHelper.DownloadEpisodeCached?,
|
||||
val currentOngoingDownloads: Int,
|
||||
|
@ -58,7 +58,7 @@ data class DownloadHeaderClickEvent(
|
|||
)
|
||||
|
||||
class DownloadAdapter(
|
||||
var cardList: MutableList<VisualDownloadCachedAbstract>,
|
||||
var cardList: List<VisualDownloadCachedAbstract>,
|
||||
private val clickCallback: (DownloadHeaderClickEvent) -> Unit,
|
||||
private val movieClickCallback: (DownloadClickEvent) -> Unit,
|
||||
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
|
|
@ -71,7 +71,7 @@ class DownloadChildFragment : Fragment() {
|
|||
}
|
||||
|
||||
(binding?.downloadChildList?.adapter as DownloadAdapter? ?: return@main).cardList =
|
||||
eps.toMutableList()
|
||||
eps
|
||||
binding?.downloadChildList?.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class DownloadFragment : Fragment() {
|
|||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun setList(list: List<VisualDownloadHeaderCached>) {
|
||||
main {
|
||||
(binding?.downloadList?.adapter as DownloadAdapter?)?.cardList = list.toMutableList()
|
||||
(binding?.downloadList?.adapter as DownloadAdapter?)?.cardList = list
|
||||
binding?.downloadList?.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue