From 58ba160571b0a337dbd199610a6533f9d9bf8a71 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 25 Jun 2019 11:19:56 +0200 Subject: [PATCH] show a placeholder text if search gives no results --- .../gallery/pro/activities/MediaActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 1e8f78974..dfae84429 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -333,6 +333,13 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { filtered.sortBy { it is Medium && !it.name.startsWith(text, true) } val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList, mPath) runOnUiThread { + if (grouped.isEmpty()) { + media_empty_text_label.text = getString(R.string.no_items_found) + media_empty_text_label.beVisible() + } else { + media_empty_text_label.beGone() + } + getMediaAdapter()?.updateMedia(grouped) measureRecyclerViewContent(grouped) }