diff --git a/app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt b/app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt index cfc17f7a6..c28aa06a6 100644 --- a/app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/DownloadsFragment.kt @@ -27,6 +27,11 @@ class DownloadsFragment : BaseFragment() { val files = DownloadHelper.getDownloadedFiles(requireContext()) + if (files.isEmpty()) return + + binding.downloadsEmpty.visibility = View.GONE + binding.downloads.visibility = View.VISIBLE + binding.downloads.layoutManager = LinearLayoutManager(context) binding.downloads.adapter = DownloadsAdapter(files) } diff --git a/app/src/main/res/layout/fragment_downloads.xml b/app/src/main/res/layout/fragment_downloads.xml index 676f095ff..cb921bf70 100644 --- a/app/src/main/res/layout/fragment_downloads.xml +++ b/app/src/main/res/layout/fragment_downloads.xml @@ -1,12 +1,36 @@ - + + + + + + + + android:layout_height="wrap_content" + android:visibility="gone" /> - \ No newline at end of file + \ No newline at end of file