fix thumbnail grouping at Search

This commit is contained in:
tibbi 2018-06-22 21:37:09 +02:00
parent cd79467ff6
commit b61e3b7d3d

View file

@ -274,6 +274,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean { override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
mIsSearchOpen = false mIsSearchOpen = false
media_refresh_layout.isEnabled = config.enablePullToRefresh media_refresh_layout.isEnabled = config.enablePullToRefresh
searchQueryChanged("")
return true return true
} }
}) })
@ -283,8 +284,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
Thread { Thread {
val filtered = mMedia.filter { it is Medium && it.name.contains(text, true) } as ArrayList val filtered = mMedia.filter { it is Medium && it.name.contains(text, true) } as ArrayList
filtered.sortBy { it is Medium && !it.name.startsWith(text, true) } filtered.sortBy { it is Medium && !it.name.startsWith(text, true) }
val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList<Medium>, mPath)
runOnUiThread { runOnUiThread {
getMediaAdapter()?.updateMedia(filtered) getMediaAdapter()?.updateMedia(grouped)
} }
}.start() }.start()
} }