From fb0054d15e282cb6a3974b5154dbecaeff87c3d6 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 7 Feb 2023 19:36:59 +0100 Subject: [PATCH] Fix the downloads empty indicator --- .../com/github/libretube/ui/fragments/DownloadsFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt index 52d0ebfac..3d862d05e 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt @@ -108,11 +108,11 @@ class DownloadsFragment : BaseFragment() { binding.downloads.adapter?.registerAdapterDataObserver( object : RecyclerView.AdapterDataObserver() { override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) { - if (itemCount == 0) { + super.onItemRangeRemoved(positionStart, itemCount) + if (binding.downloads.adapter?.itemCount == 0) { binding.downloads.visibility = View.GONE binding.downloadsEmpty.visibility = View.VISIBLE } - super.onItemRangeRemoved(positionStart, itemCount) } } )