Clean empty text view

Signed-off-by: James Wells <james@jameswells.net>
This commit is contained in:
James Wells 2021-04-13 22:35:06 -04:00
parent 9e16b69fc3
commit 39c94fe1e9
No known key found for this signature in database
GPG Key ID: 7A9AB99C0B899FB7
1 changed files with 9 additions and 3 deletions

View File

@ -74,7 +74,7 @@ class SelectAlbumFragment : Fragment() {
private var header: View? = null
private var selectFolderHeader: SelectMusicFolderView? = null
private var albumButtons: View? = null
private var emptyView: View? = null
private var emptyView: TextView? = null
private var selectButton: ImageView? = null
private var playNowButton: ImageView? = null
private var playNextButton: ImageView? = null
@ -217,7 +217,7 @@ class SelectAlbumFragment : Fragment() {
downloadButton = view.findViewById(R.id.select_album_download)
deleteButton = view.findViewById(R.id.select_album_delete)
moreButton = view.findViewById(R.id.select_album_more)
emptyView = view.findViewById(R.id.select_album_empty)
emptyView = TextView(requireContext())
selectButton!!.setOnClickListener(
View.OnClickListener
@ -1118,7 +1118,13 @@ class SelectAlbumFragment : Fragment() {
playAllButtonVisible = !(isAlbumList || entries.isEmpty()) && !allVideos
shareButtonVisible = !isOffline(context) && songCount > 0
emptyView!!.visibility = if (entries.isEmpty()) View.VISIBLE else View.GONE
if (entries.isEmpty()) {
emptyView!!.text = "No Media Found"
emptyView!!.setPadding(10, 10, 10, 10)
albumListView!!.addHeaderView(emptyView, null, false)
} else {
albumListView!!.removeHeaderView(emptyView!!)
}
if (playAllButton != null) {
playAllButton!!.isVisible = playAllButtonVisible