mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
show when downloads are empty
This commit is contained in:
parent
b838e319f5
commit
9c91386ecd
@ -27,6 +27,11 @@ class DownloadsFragment : BaseFragment() {
|
|||||||
|
|
||||||
val files = DownloadHelper.getDownloadedFiles(requireContext())
|
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.layoutManager = LinearLayoutManager(context)
|
||||||
binding.downloads.adapter = DownloadsAdapter(files)
|
binding.downloads.adapter = DownloadsAdapter(files)
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,36 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?android:attr/colorBackground">
|
android:background="?android:attr/colorBackground">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/downloads_empty"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:src="@drawable/ic_download" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/emptyList"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/downloads"
|
android:id="@+id/downloads"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
</LinearLayout>
|
</FrameLayout>
|
Loading…
Reference in New Issue
Block a user