From b61e3b7d3d08889df36276935a8ee47139e01800 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 22 Jun 2018 21:37:09 +0200 Subject: [PATCH] fix thumbnail grouping at Search --- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 66b5278f5..ca323870a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -274,6 +274,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { override fun onMenuItemActionCollapse(item: MenuItem?): Boolean { mIsSearchOpen = false media_refresh_layout.isEnabled = config.enablePullToRefresh + searchQueryChanged("") return true } }) @@ -283,8 +284,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { Thread { val filtered = mMedia.filter { it is Medium && it.name.contains(text, true) } as ArrayList filtered.sortBy { it is Medium && !it.name.startsWith(text, true) } + val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList, mPath) runOnUiThread { - getMediaAdapter()?.updateMedia(filtered) + getMediaAdapter()?.updateMedia(grouped) } }.start() }