From c97d8538f0c0943f8cef48ef8995edde127dd7fe Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 19 Feb 2019 14:31:55 +0100 Subject: [PATCH] Improved search view - collapse empty path view --- .../zderadicka/audioserve/fragments/FolderFragment.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/zderadicka/audioserve/fragments/FolderFragment.kt b/app/src/main/java/eu/zderadicka/audioserve/fragments/FolderFragment.kt index eda8a52..66e604e 100644 --- a/app/src/main/java/eu/zderadicka/audioserve/fragments/FolderFragment.kt +++ b/app/src/main/java/eu/zderadicka/audioserve/fragments/FolderFragment.kt @@ -255,7 +255,15 @@ class FolderAdapter(val context: Context, val isSearch:Boolean, } if (holder.isSearch) { - holder.folderPathView?.text = pathFromFolderId(item.mediaId!!) + val path = pathFromFolderId(item.mediaId!!) + holder.folderPathView?.apply { + text = path + if (path.isNullOrBlank()) { + visibility = View.GONE + } else { + visibility = View.VISIBLE + } + } } }