This commit is contained in:
Luna712 2024-06-19 11:12:44 -06:00 committed by GitHub
parent fa14b5e17f
commit aba5ea9a44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -39,8 +39,8 @@ data class VisualDownloadChildCached(
): VisualDownloadCachedAbstract(currentBytes, totalBytes, data) ): VisualDownloadCachedAbstract(currentBytes, totalBytes, data)
data class VisualDownloadHeaderCached( data class VisualDownloadHeaderCached(
override val totalBytes: Long,
override val currentBytes: Long, override val currentBytes: Long,
override val totalBytes: Long,
override val data: VideoDownloadHelper.DownloadHeaderCached, override val data: VideoDownloadHelper.DownloadHeaderCached,
val child: VideoDownloadHelper.DownloadEpisodeCached?, val child: VideoDownloadHelper.DownloadEpisodeCached?,
val currentOngoingDownloads: Int, val currentOngoingDownloads: Int,
@ -58,7 +58,7 @@ data class DownloadHeaderClickEvent(
) )
class DownloadAdapter( class DownloadAdapter(
var cardList: MutableList<VisualDownloadCachedAbstract>, var cardList: List<VisualDownloadCachedAbstract>,
private val clickCallback: (DownloadHeaderClickEvent) -> Unit, private val clickCallback: (DownloadHeaderClickEvent) -> Unit,
private val movieClickCallback: (DownloadClickEvent) -> Unit, private val movieClickCallback: (DownloadClickEvent) -> Unit,
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { ) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

View file

@ -71,7 +71,7 @@ class DownloadChildFragment : Fragment() {
} }
(binding?.downloadChildList?.adapter as DownloadAdapter? ?: return@main).cardList = (binding?.downloadChildList?.adapter as DownloadAdapter? ?: return@main).cardList =
eps.toMutableList() eps
binding?.downloadChildList?.adapter?.notifyDataSetChanged() binding?.downloadChildList?.adapter?.notifyDataSetChanged()
} }
} }

View file

@ -64,7 +64,7 @@ class DownloadFragment : Fragment() {
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
private fun setList(list: List<VisualDownloadHeaderCached>) { private fun setList(list: List<VisualDownloadHeaderCached>) {
main { main {
(binding?.downloadList?.adapter as DownloadAdapter?)?.cardList = list.toMutableList() (binding?.downloadList?.adapter as DownloadAdapter?)?.cardList = list
binding?.downloadList?.adapter?.notifyDataSetChanged() binding?.downloadList?.adapter?.notifyDataSetChanged()
} }
} }